2014-03-31 20:39 GMT+02:00 Thiago L. <fakedme@gmail.com>:
local stringmetatable = getmetatable("")
debug.setmetatable("", function(key)
if key == "__metatable" then
-- some magic
else
-- some other magic to get the env and do stuff (and then we use the stuff
from the __metatable hack)
end)
You can achieve this effect already:
local stringmetatable = getmetatable("")
debug.setmetatable("", setmetatable({},{
__index = function(key)
if key == "__metatable" then
-- some magic
else
-- some other magic to get the env and do stuff (and then we use the stuff
from the __metatable hack)
end}))