lua-users home
lua-l archive

Re: Extra Lua table in a library registration

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


Geo Massar wrote:
 // Store Scene functions in 'scene' table
 luaL_openlib(L, 'scene', @_sceneLib, 0);
 // Store Scene constants in 'scene' table
 lua_pushstring(L, 'scene');
 lua_gettable(L, LUA_GLOBALSINDEX);
luaL_openlib leaves the created table on top of the stack, so you can elide the calls to pushstring and gettable here.
					-Mark

AltStyle によって変換されたページ (->オリジナル) /