Accessing Type Metatables Lua -


its getmetatable can access metatables of several types:

getmetatable("") getmetatable({}) getmetatable(newproxy(true)) 

however appears though cannot metatable of other types (functions aside). there appears no way access metatable of numbers, booleans, or nil.

i wondering if 1 able access metatable of entire table type. able this:

({}) + ({}) 

numbers, booleans , nil have no metatable default (hence getmetatable returning nil). can give them 1 debug.setmetatable though.

there no common table metatable. (and same userdata (at least of heavy variety))


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -