Conversation
Notices
-
Embed this notice
tech? no! man, see... (technomancy@icosahedron.website)'s status on Friday, 19-Jan-2024 13:26:06 JST tech? no! man, see... -
Embed this notice
gwemprine (gwenprime@www.librepunk.club)'s status on Friday, 19-Jan-2024 13:26:08 JST gwemprine x = {
__type = 'number',
}
y = setmetatable({}, x)
print(type(y)) -- 'table'
_G.old_type = type
type = function(target)
local mt = getmetatable(target)
if mt and mt.__type and type(mt.__type) == 'string' then
return mt.__type
end
return old_type(target)
end
print(type(y)) -- 'number'
-
Embed this notice