lua-users home
lua-l archive

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


Actually what I'm doing is (I think) really simple, but since I have 
yet to seriously use Lua, I'm probably doing this all wrong, like 
bitflags =).  

I have an API call in my framework to "set the current table" so that 
I can then iterate over its members or find a member.  Since I wasn't 
aware of a special table name for the globals, I would simply call 
lua_getglobals() if I wanted to select the global table.

I had a fairly simple scanner that would then allow me to reference 
items in C code as if it were a directory structure, e.g. if I wanted 
to access foo.x.y I could specify it as:

getValue( "/foo/x/y" );

but if "foo" was already selected, I could also do:

selectTable( "x" );
getValue( "y" );

etc.

So the important bit is that sometimes I wanted to set the global 
table as current, and other times I wanted to select a named table, 
depending on where I was trying to search the name space.

Does this make sense?

Brian