lua-users home
lua-l archive

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


This is now slightly off-topic, but

I don't suppose there is a way to identify 'system' tables, such as
os,_G,math, and etc.?

-Raymond



On 1/19/07, Rici Lake <lua@ricilake.net> wrote:

On 19-Jan-07, at 9:57 PM, Raymond Jacobs wrote:

> And if not, is the fact that i am asking for a string (lua_tostring),
> all the time for the table key a problem?

Yes. Either lua_tostring() will change the key into something else,
which is a problem, or it will return NULL, which might cause your
writeString() function to segfault.
>
> One thing i noticed is the first element's key in the subtable is "1",
> which I wasn't expecting, but I guess it uses numbers if you dont
> supply an actual key.

Numbers are "actual" keys. Tables are mappings from the set of Lua
objects into the set of Lua objects.