[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 20:20:14 -0300
> _META[t] = mt -- instead of setmetatable(t,mt)
> mt = _META[t] -- instead of mt = getmetatable(t)
You can already experiment with this syntax. Just do
_META = setmetatable({},{__index = getmetatable, __newindex = setmetatable})
Are you proposing that Lua should always create this behind the scenes?
This is totally different in nature from the introduction of _ENV.
While it was a simple, consistent solution, it did require some magic
in the compiler: the creation of _ENV as an upvalue behind the scenes.
- 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