lua-users home
lua-l archive

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


Roberto Ierusalimschy <roberto <at> inf.puc-rio.br> writes:
> > Is setting a metatable on the registry supported?  Should it be?
>
> The registry is a regular table, so you can set a metatable for it.

Interestingly enough, I just ran into the opposite problem.  It appears
that my __gc method isn't respected when I do the C equivalent of:

setmetatable({}, {__index = {__gc = foo}})

Lua only seems to find __gc when it is set directly on the metatable.
It doesn't find it via __index.

Josh