lua-users home
lua-l archive

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


On Thu, Feb 15, 2001 at 03:27:37PM +0000, Nikos K Gorogiannis wrote:
> 
> Missing functionality:
> * proper type checking in Lua (inheritance breaks it)
> * multiple inheritance (not sure if it's any good though)
> * objects always must be default constructible
> * garbage collection

No garbage collection? Attach a userdata object(your T*) as a hidden item in
the Lua table, associate a new tag value to the userdata, add a "gc" tag
method for that tag to your destructor_callback function. 

Lua will gc your table when it goes out of scope or there are no 
references to it. The gc runs into your userdata object and will call your
destructor_callback which deletes the object.

See my Luna code.

-Lenny.