lua-users home
lua-l archive

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


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