lua-users home
lua-l archive

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


> 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