lua-users home
lua-l archive

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


Hello All,

>     I'm using this code to get and store the global table from a state:
>
>     lua_pushvalue(l, LUA_GLOBALSINDEX);
>     lua_pushstring(l,"mynamespace_globaltable");
>     lua_settable(l,LUA_REGISTRYINDEX);

please, swap the two pushes above.

>
>     But, can I use another form that don't use the registry to store the
> table? This is because I can't set in the global table or its children,
and
> I don't want to store in the registry table. Someone has a suggestion?

    The above questions persist.

>     Another question: can I replace the global table with a userdata with
> metatable? Or lua checks if global table is a real table?

    Here, I answer myself, and perhaps is useful to others: yes, I can't
because lua verify if it's a real table, and fires an assert.

                                                The God's Peace,


Leandro.