lua-users home
lua-l archive

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


David Given <dg@cowlark.com> wrote:
> All my Lua files tend to start with the same boilerplate containing
> lists of:
> 
> local string_find = string.find
> local table_insert = table.insert
> local print = print
> 
> ...etc. It would be really nice to be able to common this somehow.

I agree. Lexical is all nice and well but sometimes a textual approach
is simply more sensible.

So I adapted and enhanced a macro package originally written by steve d.
Among other things this supports an __INCLUDE(filename) macro. There is
a version for Lua* here (includes full source):
http://thomaslauer.com/download/LuMaX.zip

* Runs on standard Lua, but requires lhf's token filter compiled in.

HTH.

-- 
cheers  thomasl

web: http://thomaslauer.com/start