lua-users home
lua-l archive

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

>     lua_settop(L, 2);   /* as before, zap extra args if any */

There's no need for this in common usage.
lua_settop is only needed to remove unwanted *return* values from functions
called inside loops.
lua_settop is also used to set absent argumens to nil.

>PD: I actually recommend not putting stuff like that in globals, since it
>is relative to a lua_State. Using globals means that whatever you write
>will only work in a single lua_State, which may prove limiting later on.

So, use the registry, which was created exactly for this.