lua-users home
lua-l archive

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


Miles Bader writes:
> Bret Victor writes:
> > I thing I like about Lua syntax is that punctuation is kept minimal, 
> > and words are used (in, do, end) when that's how you would read the 
> > code out loud.
> 
> I agree, in general -- I don't dislike punctuation heavy languages like
> C, but Lua has a consistent and attractive style of its own.  [Still, in
> the middle of an expression, I think a punctuation-oriented lambda
> syntax isn't out of place, even in Lua.]

In Lua, we do write "{1,2}" rather than "table 1, 2 end".  Given that functions
are fundamental data type, like tables, there is consistency in using
punctuation to denote functions, particularly when used as lambda expressions.

Approaches for syntactically lightweight closures are also discussed in [1].

[1] http://lua-users.org/wiki/ShortAnonymousFunctions