lua-users home
lua-l archive

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

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 <> 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.