[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting and storing global table in C
- From: "Leandro Candido" <enclle@...>
- Date: Thu, 18 Dec 2003 16:00:01 -0200
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.