lua-users home
lua-l archive

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


Hi list,

I'm wonder how to change _ENV's value, or rebuild a new _ENV locals in
C function. the only idea I make out is using a wrapping lua code:

lua_newtable(L);
lua_pushcfunction(L, myfunc);
luaL_loadstring(L, "local _ENV,func = ... return func()");
lua_call(L, 2, 0);

Is there any other method to change _ENV in a C function using a pure C API?

regards :-)

- Xavier