lua-users home
lua-l archive

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


On Mon, Nov 29, 2010 at 9:27 AM, Juris Kalnins <juris@mt.lv> wrote:
> $ - x --> return ... - x

Maybe I haven't had enough tea yet, but that scared me until I
realized you were comparing syntaxes ;)  Definitely don't like $, that
feels far too much like Perl [1].

But 'return expr-referencing-varargs' _is_ cool, _if_
'expression-context' is unambiguous.

Gets awkward for functions of more than one variable, of course, but
short-forms have to be limited to work well.

An underscore _ reads better than ... here, and there has been
suggestions that _1, _2, etc acquire special meaning, a la Boost
lambda:

res = fun(return _1+_2)

steve d.

[1] In the Awk FAQ, the answer to 'Why not just use Perl?' is (a) Awk
is somewhat smaller and (b) you don't have to use $ for variables ;)