[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Expanding multiple return values of Lua functions in a Lua table constructor
- From: Peter Cawley <lua@...>
- Date: Thu, 18 Oct 2012 11:27:42 +0100
On Thu, Oct 18, 2012 at 11:13 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> `[lst]` could force the non-adjustment.
>> `t={[a()],[b()],"third"}`
>
> What would t={[a()]=2} mean then? It already has a meaning.
It would keep the current meaning, as in the following definition of field:
field ::= ‘[’ exp ‘]’ ‘=’ exp | '[' explist ']' | Name ‘=’ exp | exp
We already have `t={foo}` and `t={foo=4}` meaning very different
things, now the same would also be true of `t={[foo()]}` and
`t={[foo()]=4}`.