lua-users home
lua-l archive

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

On Thu, 2006-26-01 at 10:28 +0000, Lisa Parratt wrote:
> This might be OT, and possibly unsuitable for the list, but I'd be 
> fascinated to see an example of such a facility.

If you want to see it in a language that has it already, drop by and poke around.  It's still pretty hairy (lots of
build problems) since it's very much a work in progress, but Io has lots
of Lua-like spirit behind it with a really cool system underlying it

> I guess it could be argued that it's not OT if one is considering adding 
> such abilities to Lua :)

If there were some way to access (and manipulate, of course) Lua's parse
tree as it was processed you could build a syntax extender into it.  Io
(and Lisp/Scheme) can make syntax extension easily by virtue of not
really having a syntax.  Making one that works over the parse tree (like
Dylan did or a Lua implementation would have to) is... non-trivial.
It'd obviously doable (as Dylan shows), but it's prone to some seriously
hirsute areas.

Of concern to me would be to avoid the Dylan trap of making the macro
system fundamentally a different language from the core language.
Dylan's macro system was Lisp-like in structure (since Dylan started as
a Lisp derivative and only inherited a more conventional syntax later
on).  There was talk about moving the macro system into a syntax that
more closely matched the core language, but the project got killed at
Apple before that could happen and the language died a gruesome death
after that.  I'm not convinced that the conversion could happen, though.
I think there's a reason why hygenic macros seem to only show up in
languages that basically don't have a syntax.  ;-)

Michael T. Richter
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:

Attachment: signature.asc
Description: This is a digitally signed message part