lua-users home
lua-l archive

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


On Wed, Nov 24, 2010 at 10:32 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Wed, Nov 24, 2010 at 2:29 PM, Axel Kittenberger <axkibe@gmail.com> wrote:
>> myfunc(function(x) return x end, x)
>
> It would bind to the next expression; here the comma is just an
> argument separator.
>
> However, there _is_ an operator precedence question.
>
> As for multiple returns, probably best either to not allow it or
> require explicit parens
>
> lambda(x) (x-1,x+1)

Perhaps make parens mandatory: (\x -> x-1, x+1)

list:map(\x -> x*x)  --> list:map( (\x -> x*x) ) --> list:map(
function(x) return x*x end )

selectf( exp, (\-> t.foo), (\-> t.bar) )

window:setCallback(\event : print(event.target) -> false )

The positive side of this is that you don't need to surround blocks
with do..end. The parenthesis already does the trick.

Now we just need list comprehensions: { x  | x <- list, (\i-> i %2 == 0 ) }
=)

--rb