lua-users home
lua-l archive

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

>RH> How about Lua sending the text through some preprocessor first?
>I think some sort of hook function might be neat, that is called
>before the lua code is actually compiled, and may alter the source
>code. With such a thing, C style #defines could be implemented, but
>also more complex things like a scheme-style hygienic macro
>preprocessor. I have no need for that currently, but it would be cool
>to have. Might pose some interesting problems, though...

A primitive form of hook already exists because lua_load, which is the *only*
way to compile Lua code, calls a user function to get blocks of data. In this
function, you can do as you please. I'm not saying that it's easy, I'm only
saying that the mechanism is already in place.