[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: multiple lua files with same-named functions
- From: "Raymond Jacobs" <raymondj@...>
- Date: Fri, 5 May 2006 13:26:41 -0400
This sounds potentialy viable (the second idea), however I am still pretty new to lua,
could you explain in more detail how I would do it?
On 5/5/06, Luiz Henrique de Figueiredo <email@example.com> wrote:
> 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.