lua-users home
lua-l archive

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


Yes, require() is not going to work as you want it to. But it would be
possible to rewrite it so that it sets the environment of the blabla
module to be the environment of the caller.  It would (1) use
getfenv(2) to find out caller env (2) find the module using
package.path & load the file (3) set the module chunk env and execute
it and (4) keep track of its loaded status.

Thank you. I will try to write this new require.

victor