lua-users home
lua-l archive

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


> _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.