lua-users home
lua-l archive

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

> In fact I find that it only works if a full userdata is tagged with a
> metatable.  But that’s not what the docs say.

The documentation in fact explicitly states that only full userdata
and tables can have their own metatable.
The following citation comes from chapter 2.8 of the reference manual [1]

"Tables and full userdata have individual metatables (although
multiple tables and userdata can share their metatables). Values of
all other types share one single metatable per type; that is, there is
one single metatable for all numbers, one for all strings, etc. "