lua-users home
lua-l archive

Replacing LUA_GLOBALSINDEX when porting 5.1 libs to 5.2...

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


Can this 5.1 code:
 lua_getfield(L, LUA_GLOBALSINDEX, name);
be made ready for 5.2 by writing this instead:
 lua_pushglobaltable(L);
 lua_getfield(L,-1,name);
 lua_remove(L,-2);
?
(Apologies if this has been covered before. A mail archive search suggested it hadn't.)

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