lua-users home
lua-l archive

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


Nicolas Noble wrote:
Pah! Forget it. I read the manual a bit deeper, and I understood it works
_only_ for userdatas, not for tables. Really sorry for having wasted your
time ^^;

Ah yes, sorry, I forgot that detail because I routed around it...
let me try to remember how. :)

You can still make a __gc that works on tables, by putting
a unique userdata (with the real gc method on it, as proxy)
in a global table WEAKLY keyed by the table which you want
the __gc to activate for.

--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
Consume Less, Live More