[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: metatable for the registry?
- From: Josh Haberman <jhaberman@...>
- Date: Mon, 19 Jul 2010 02:35:00 +0000 (UTC)
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