[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Short function definition syntax; thoughts on Lua
- From: David Kastrup <dak@...>
- Date: Sat, 05 Dec 2009 11:00:24 +0100
spir <denis.spir@free.fr> writes:
> function (x,y,z) (x+y*z)
>
> This avoids the need for both '=' and an 'end' token.
> (I guess "function(...)(...)..." is well a syntax error as of now?)
(function(x,y,z) (print)(x,y,z) end)(3,4,5)
is perfectly legal Lua code.
I find the attempts to squeeze some constructs into coincidentally
existing gaps of the syntax table even less savory than the |x|
jugglery. At least with the latter, the unsuspecting newby will
_recognize_ a construct that he does not know, unless it is wrapped in
things like map(|| print("and another one")).
Since all arguments against || hold at least equally as well for
shorthands mashed together from existing syntactical scraps, but the
latter are less recognizable as being a shorthand by user and possibly
compiler, I don't think that the search for alternate _syntaxes_ for
this shorthand leads anywhere sensible.
--
David Kastrup
- References:
- [ANN] GSL Shell new beta release with anti-gran graphics module, Francesco Abbate
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, steve donovan
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, David Kastrup
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, Norman Ramsey
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, David Kastrup
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, Norman Ramsey
- Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), Doug Rogers
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), steve donovan
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), Luiz Henrique de Figueiredo
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), spir