lua-users home
lua-l archive

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

On Wed, Nov 24, 2010 at 13:29, Axel Kittenberger <> wrote:
>> filter(lambda(x) x % 2 == 0)
> hmm also some uses not claerly defined, not nice:
> myfunc(lambda(x) x, x)

AFAICT, the only unambiguous syntax is the following:

    `initial_token` [arglist] `separator` [chunk] `final_token´
    `initial_token` [arglist] `separator` [explist] `final_token´

with `final_token` ~= `initial_token`, and various restrictions on the
individual tokens to avoid ambiguities.

It can be reduced to
    `initial_token` [arglist] `separator` expression
if you allow only one return value.