lua-users home
lua-l archive

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


> > filter(lambda(x) x % 2 == 0)
> 
> hmm also some uses not claerly defined, not nice:
> 
> myfunc(lambda(x) x, x)
> 
> is this:
> myfunc(function(x) return x, x end)
> or
> myfunc(function(x) return x end, x)
> ?

Second option; actually, what I was proposing was more like

lambda `(' [par] `)' exp

but to avoid the ambiguity we could add a final token

lambda `(' [parlist] `)' explist end

albeit with a marginal gain over 'function'...

Cheers,
Luis

-- 
Computers are useless. They can only give you answers.
                -- Pablo Picasso

-- 
Luis Carvalho (Kozure)
lua -e 'print((("lexcarvalho@NO.gmail.SPAM.com"):gsub("(%u+%.)","")))'