|
On 7 Jan 2006, at 10:22, CHU Run-min wrote:
The standard dofile executes the lua chunk in the global environment. I think it should be in the environment of the caller of dofile. See the following: local std_loadfile=loadfile function dofile(filename) local func=assert(std_loadfile(filename)) setfenv(func,getfenv(2)) func() end