lua-users home
lua-l archive

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


On Mon, 15 Sep 2008, David Given 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 suppose if you aren't using bytecode you could append your boilerplate
to the start of a module when loading it. Slightly grotty, though.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
SOLE: NORTHERLY 3 OR 4, INCREASING 5 OR 6. MODERATE OR ROUGH. SHOWERS.
MODERATE OR GOOD.