lua-users home
lua-l archive

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


Why get/setmetatable() are necessary?

One could simply set a special key such as __metatable by writing something like 

mt = {}
t = {}
t.__metatable = mt 

Instead of writing 

setmetatable(t,mt)

And similarly for getmetatable()

So what is the reason to keep these functions? 

This question is born from looking at the language evolution: there were set/getfenv() and now there is just a special __ENV

    Andrea 
--
Andrea Vitali






_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org