[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Metatables are "hard" (Re: Question about __index and classes)
- From: HyperHacker <hyperhacker@...>
- Date: Sun, 11 Sep 2011 02:10:47 -0600
On Sun, Sep 11, 2011 at 02:03, Axel Kittenberger <firstname.lastname@example.org> wrote:
>> Isn't that what __metatable is for? (Or don't give it access to
>> getmetatable(), or at least give it a wrapper that refuses to work on
>> your objects, if you need that for some reason...)
> Oh yes, it never occurred to me, I could just override-replace the
> default getmetatable function.
If you do that, don't forget about debug.getmetatable() too. (Or
perhaps if your objects are so sensitive you don't want to leak their
metatables, it's best to leave out the debug module entirely.) :-)
Sent from my toaster.