lua-users home
lua-l archive

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

Roberto Ierusalimschy wrote:
Now C libraries can have their own environments; so, some luaopen_xxx
functions can change their environments to propagate the new environment
to the functions they create. However, when a luaopen_xxx is called
directly from the main program (the usual thing in the case of the
standard libraries), the environment they are changing is the main
program environment. This is by itself bad (for now luaopen_stdlibs
undoes the change, but this is a hack), but becomes an error if the
"main program" is not a C function (as in your code).

Thanks, I've restructured my init sequence (though only my init
sequence) to similarly use lua_cpcall() as a workaround and things
seem to be smooth again now.

Adam D. Moss   -