type=function(o)
if getmetatable(o)==_EMPTYMT then
return 'empty'
else
return type(o)
end
end
This of course would have to be:
do
local oldtype=type
type=function(o)
if getmetatable(o)==_EMPTYMT then
return 'empty'
else
return oldtype(o)
end
end
end
Otherwise you end up in an infinite tail-call loop :)