lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Aug 20, 2015 at 10:18 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great William Ahern once stated:
>>
> 2) Allow a method to create new literals.  Here me out.  If we do this, and
> set up some way of writing code to understand literals, then we can pull
> strings out of the core and into an actual module.  Really, the only
> difference between a string and a userdata is that there's support for
> string literals in core.

Sometimes I've thrown around the idea in my head, that if several
identifiers appear in sequence, they could be concatenated or chained
somehow, similar to the existing f"foo" and f{foo} syntax:

local x = persistent unsigned integer 3
--parses as: local x = persistent(unsigned(integer(3)))
--or even: local x = persistent("unsigned")("integer")(3)

That could make for some quite interesting syntaxes.