lua-users home
lua-l archive

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


>From lua-l@tecgraf.puc-rio.br Wed Jul 28 13:01:30 1999
>From: Fred Bertsch <fb@anise.ee.cornell.edu>

>Every so often, this list mentions the possibility of adding something
>like Scheme's hygenic macros to Lua.  What was the latest state of that
>suggestion? 

We are currently considering a simple but powerful macro facility for the
next version.
Something like: when the lexer sees a $ sign followed by a char or id,
it will call a Lua function to handle the streams of tokens from that point
on. This function would feedback a string to the lexer.
This follows Lua's philosophy of meta-mechanisms.
For instance, it would allow the current preprocessing facilities to be
implemented directly in Lua, simplifying the lexer quite a bit.
(Of course, the current preprocessing facilities will be available intact
in the next version, but will be implemented with the more general scheme,
and so can be avoided or replaced if needed.)
--lhf