lua-users home
lua-l archive

Re: Question on get/setmetatable()

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


> _META = setmetatable({},{__index = getmetatable, __newindex = setmetatable})
Actually, this does not work because the args do not match. This works;
_META = setmetatable({},{
 __index = function (t,k) return getmetatable(k) end,
 __newindex = function (t,k,v) setmetatable(k,v) end
})

AltStyle によって変換されたページ (->オリジナル) /