lua-users home
lua-l archive

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


Norman Ramsey wrote:
 > Does Lua need a short lambda syntax? I like FP and lambda calculus as
 > much as the next guy, but if you want a minimalist functional language
 > what is wrong with Scheme?
Seriously, Scheme isn't 'minimalist' any longer, and it hasn't been
for a long time.  Lua has a much better power-to-weight ratio.  Even
though I hate, hate, hate the fact that I can't write anonymous
functions concisely.

As do I. I believe you and I have similar tastes. Now that hexadecimal escape sequences (and bit operations) have made it into Lua, this is on the top of my short list of desired features.

The '|args|expression' form is good for 'function(args) return expression end', though I think it would fit better with some sort of closing token. A form that accepts statements would be nice, too, but I think it would be too far from Lua's essence, whereas a syntactic sugar just for returned expressions is simple enough - and readable enough - that I believe it would be a benefit, not a detriment. My opinion, of course.

I like Scheme. It is beautiful. But I must admit that the standard seems overly complex. I couldn't tell you how to fix it, only how it appears to me.

Sorry, I just noticed the 'Shorter lambda forms' follow-up thread. This could have gone there instead.

Doug