On Sun, Dec 03, 2006 at 03:12:14PM +0100, Fabien wrote:
> A new version of metalua is available, with too many fixes to list them all.
Nice, I've not tried it yet, but AFAIK there is no extension to have
functions curryfied... Do you think it can be done easily within your
framework?
There's allready in standard Metalua a notation "|x| foobar", which means "function(x) return foobar end". You can use it to write things like "plus_curry |x| |y| x+y", then use it as "plus_curry (3) (4)".
Implementing ML-like function application is easy, it must be something like (untested):
mlp.expr.add_postfix_syntax{ mlp.expr, builder = |x| `Call{ x[1], x[2] } }
But that would make semicolons between statements mandatory. Actually, many things become only possible with mandatory semicolons, so maybe I should offer a "mandatory semicolons" mode...
Then again, it's possible to redesign a language from scratch. I haven't included it in the distribution because it's not finished, but I'm experimenting with a strictly functional dialect of Lua, whose syntax is built with gg (which is metalua's simplified Parsec). There's another hack which might interest functional programmers, which I hope to release soon: a lazy semantics for Lua. My currentl issue is that I'd like lazy fragments to cohabitate seamlessly with eager ones...