[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 4 Dec 2009 08:12:38 -0200
> But there is a middle way; say there was a new keyword 'lambda', so
> that we can say lambda(arglist) expr, then a token filter could easily
> transform |x| into lambda(x).
Why 'lambda' when 'function' exists and works just as well?
And one possible syntax could be
which is reminiscent of Fortran one-line function statements except that
defines anonymous functions.
This syntax is even friendlier to token filters because you only need to
convert '=' to 'return' but the real problem is of course how to detect
the end of the expression so that 'end' can be added.