lua-users home
lua-l archive

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


> 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