lua-users home
lua-l archive

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

Whwn registering a library I believe it is necessary to lua_call the
luaopen_ function (methinks so that LUA_ENVIRONINDEX works).
Someone tell me if I am wrong.
My question is when I wish to add some functions to an existing
namespace do I also need to lua_call or can I simply call
against the existing table?


    lua_pushcfunction(L, luaopen_mylib);
    lua_pushstring(L, "mylib");
    lua_call(L, 1, 0);

[sometime later]
  static struct luaL_Reg morefuncs[] = {
 } ;
 /* presume the following does not require lua_call */
 luaL_register(L, "mylib", morefuncs);

 David B