[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Metatables cannot have metatables?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 27 Dec 2013 10:46:04 -0200
> I don't understand why this isn't working: http://pastebin.com/kGX5Eay0
> When asking for #t, it should check the metatable "meta" for a __len
> method. But this doesn't seem to invoke "meta"'s __index metamethod.
The manual says that access to metatables are raw:
metatable(obj)[event]
should be read as
rawget(getmetatable(obj) or {}, event)
http://www.lua.org/manual/5.2/manual.html#2.4