[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] GSL Shell new beta release with anti-gran graphics module
- From: Francesco Abbate <gslshell@...>
- Date: Thu, 3 Dec 2009 15:01:15 +0100
2009/12/3 David Kastrup <firstname.lastname@example.org>:
> And it can't even sensibly deal with multiple return values.
> local x=3
> fun2(|x| x*x,x)
> Is this
> fun2(function(x) return x*x end, x)
> fun2(function(x) return x*x, x end)
I think you didn't understood the point. The notation
in meant to replace
function(<args>) return <expr> end
only in the case we have an expression and returned value. As you
should know, in Lua, a comma separated list of expression is *not* an
expression so there is no ambiguity whatsoever.
I repeat it:
- the comma ',' is *not* an operator in Lua
- a comma separated list of expression is *not* an expression
so there is no ambiguity. If you want to return multiple values you
should use the ordinary notation.