[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Some enhancements in table initializations
- From: Jonathan Castello <twisolar@...>
- Date: Mon, 20 Sep 2010 20:53:57 -0700
On Mon, Sep 20, 2010 at 8:29 PM, Nilson <email@example.com> wrote:
> Proposition 1. Make the separator optional in table initialization
> Proposition 2. Extending the function name syntactic sugar to tables.
If they're doable, I like these two a lot.
> Proposition 3: Unquoted strings constants
> Well, the idea is: in table initializations, when the compiler uses
> the production field ::= exp and the exp is a single Name
> and Lua could not find a value, it will return the lexical element
> Name as a string.
Not something I'd really like, personally. Besides, you can do this
yourself with a metatable on _G (or whatever the current environment
table is) with an __index method that returns the key itself.