[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] GSL Shell new beta release with anti-gran graphics module
- From: Miles Bader <miles@...>
- Date: Thu, 03 Dec 2009 19:49:32 +0900
steve donovan <email@example.com> writes:
> Perhaps the issue here is that those two little lines are easy to get
> lost in the otherwise keyword-driven syntax of Lua?
I think that's the _point_ -- "function (..) return ... end" is _too_
noticeable, and so obscures the actual important bits in situations
which the || notation is intended for.
some_fun (foo, function (x) return x*x end)
some_fun (foo, |x| x*x)
the latter is far more readable because the important parts aren't
obscured by the heavyweight syntax of the normal function syntax.
Of course, good style would probably indicate that you should use the
normal syntax in cases where the body of the function is large.
I'd rather be consing.