[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Request for 5.4: adding [] as table creation syntax for Lua 6.0
- From: Coda Highland <chighland@...>
- Date: Wed, 13 Jul 2016 22:52:36 -0700
On Wed, Jul 13, 2016 at 10:35 PM, Thomas Jericke <tjericke@indel.ch> wrote:
> The only good solution I see is to not allow function calls by array
> constructors. So you would always have to write:
> t([])
> t([1])
> t([1,2])
> ...
>
> Disallowing only the single element case would be very error prone IMO.
I, for one, don't have a problem with this. It certainly won't look
strange; people are used to that kind of syntax.
Another option might be {[ ]}. It's not FANTASTIC, but it's still (1)
obviously a table constructor (though a specialized type) and (2) a
syntax error in current Lua so it won't break any existing code.
/s/ Adam