lua-users home
lua-l archive

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

Hash: SHA1

On 21/12/09 08:39, steve donovan wrote:
> If we get a agreed-upon, standard token-filter mechanism for vanilla
> Lua, then of course it would be easy to implement lhf's suggested
> lambda notation \x,y(x+y)  That would make the shortists happy, and
> the longists can just avoid the extension.

I should point out that Lua-to-Lua translation works really well and is
actually quite easy. Check out lexer.lua and parser.lua here:;a=tree;f=olua;h=0f0da4a15b54b36bea8e11751e81c53c6d1652e0;hb=HEAD

It's all interfaced through a custom package loader, which allows .olua
files to be loaded through require in exactly the same way as .lua
files. As more work's being done it makes load time slower, of course,
but it's nothing that anyone would ever notice.

There is an annoying limitation that the main program *itself* can't use
syntax extensions implemented in this way --- because the thing that
loads the package loader wasn't loaded *with* the package loader --- but
it may be possible to work around this using the -l command line
argument. I haven't tried that yet.

- -- 
┌─── ───── ─────
│ "Under communism, man exploits man. Under capitalism, it's just the
│ opposite." --- John Kenneth Galbrith
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -