lua-users home
lua-l archive

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


On Mon, Feb 27, 2012 at 2:49 AM, Miles Bader <miles@gnu.org> wrote:
> In this case, the point seems to be reducing the size and visual impact
> of small lambdas, which suggests not using a keyword would be better.

Yes, but there was a surprising backlash against short lambda forms.
There is a great fear that Lua could become Perl, and degenerate into
line noise.  (I appreciate that the functional style is not everyone's
cup of tea, however.)

I like a variant on the Metalua syntax:  |x|(x+1).  The parentheses
make the scope of the expression unambiguous, and the syntax gives a
clear meaning to something like |x,y|(x+y,x-y) as a function returning
two values. Plus, easy to do lexically by token-filters, macros and so
forth.

steve d.