[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question on get/setmetatable()
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 20 May 2020 21:49:32 -0300
> _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
})
- References:
- Question on get/setmetatable(), Andrea
- Re: Question on get/setmetatable(), pocomane
- Re: Question on get/setmetatable(), Philippe Verdy
- Re: Question on get/setmetatable(), Andrea
- Re: Question on get/setmetatable(), Gé Weijers
- Re: Question on get/setmetatable(), Andrea
- Re: Question on get/setmetatable(), pocomane
- Re: Question on get/setmetatable(), Andrea
- Re: Question on get/setmetatable(), Lorenzo Donati
- Re: Question on get/setmetatable(), Andrea
- Re: Question on get/setmetatable(), Luiz Henrique de Figueiredo