lua-users home
lua-l archive

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


Hi, 

I mailed this earlier, but didn't get a good response and I couldn't follow
it because some other things came up. 

Anyways, my question is, I want to get a variable from lua and check whether
the variable is of built-in type or user-defined (easy). Build-in type
variables are easy, however, in case of a user-defined variable (lets say a
class registered via lua bind or some other library) I want to "recursively"
enumerate all the children of that variable and get their value from LUA.

Last time I posted it on the list, someone told me that this was not
possible since LUA is not a type safe language and you cannot enumerate
structures and classes registered from C++ as such, but obviously LUA does
it somehow. E.g. an expression a = object:var1 + object:var2 works and it
properly calculates the offset of var1 and var2 w.r.t. the base object, and
its hard for me to believe that someone from the application side can't do
it! The reason I want such functionality is because I am developing a visual
studio plugin and I want to add support for variable watching. Simple LUA
variable watching support has been done, but now I want to add support for
complex object types, registered from C/C++ (or some other language).

Thanks in advance.

Regards,
Zulfiqar Inayat Malik.

P.S. maybe some experienced developer (perhaps the creators?) can some shed
light onto how LUA handles user-defined objects internally.