lua-users home
lua-l archive

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


> Would binding the metatable as an upvalue to the methods of a 'class' not
> be faster? You could skip the table lookup altogether, just get the
> metatable from argument 1 and compare it to the upvalue to determine
> 'class' membership.

Sure, there are probably many ways to do this. The one implemented in
lauxlib is just one. Another is to keep a weak-keyed table with all
the udata created by the module and just indexed that. I haven't tried
this yet though.