[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: multiple lua files with same-named functions
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 5 May 2006 11:20:21 -0300
> and if so how can I solve it? a brute force idea is to clear all the
> functions from the global state before loading a new script
You can run each new script in a brand new Lua state or you can set the
environment of each script after loading it but before running it to a
new table. In the second case, you'll probably want to set an __index
metamethod in the new environment to point to the global environment.
--lhf