[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: special forms, take two (was Re: A lua version of "amb")
- From: Christopher Berardi <cberardi@...>
- Date: Tue, 28 Feb 2012 06:11:11 -0500
On Sun, Feb 26, 2012 at 04:13:19PM -0700, HyperHacker wrote:
> Wouldn't a more Lua-like approach be to use a keyword "lambda" instead
> of a symbol? I think my favourite syntax would be:
> lambda x: x+1
> but that might be difficult to parse, since x:x looks like a function
> call, so maybe you'd need a double colon.
> lambda x (x+1) -- has the same problem, but even moreso since x(x+1)
> is actually a valid statement.
What about something like
lambda x -> x + 1
or
lambda x => x + 1
???
Though, I'm not certain I see the difference between this and, say,
function (x) return x + 1 end
other than it's a little shorter (though, a little syntatic sugar never
hurt anyone).
--
Christopher Berardi
http://www.natoufa.com/
May grace and peace by yours in abundance.
- References:
- A lua version of "amb", Xavier Wang
- special forms, take two (was Re: A lua version of "amb"), Jay Carlson
- Re: special forms, take two (was Re: A lua version of "amb"), steve donovan
- Re: special forms, take two (was Re: A lua version of "amb"), Jay Carlson
- Re: special forms, take two (was Re: A lua version of "amb"), steve donovan
- Re: special forms, take two (was Re: A lua version of "amb"), HyperHacker