lua-users home
lua-l archive

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

Rob Kendrick wrote:
Stephen Kellett wrote:

I'd like to see the ability to actually get a class name for a class object. Currently when you query an object for its type (from C) you just get "Table", which is not very useful. Its much more useful to know that a "Weeble" object is possibly leaking (look there are 10,000 of the critters!) rather than noticing the Table count has increased by 10,000.

Isn't the usual way of solving this problem to keep a mapping in the registry between the meta-table and type name?

I don't know. I'm not the most skilled Lua user going. I know a fair bit about Lua internals (and various other scripting languages) but I'm not that experienced at actually using Lua (most of my work is in C++ and assembly).

How would I check that from C?

Now that you've pointed me in direction I'll get out Roberto's book and have a read about Tables and the registry.