[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: undocumented features
- From: "Wim Couwenberg" <w.couwenberg@...>
- Date: Mon, 17 Feb 2003 10:18:49 +0100
Hi,
marcus.cf:
> I also found some undocumented functions in lualib (some
> peole may already know them).
[... snip snip ...]
There are more undocumented and interesting features (found while doing some
Lua 5.0 experiments):
* __metatable field: If the metatable of some object contains a
"__metatable" field then the metatable is considered "protected." This
means that a) you cannot change the metatable of that object (through
setmetatable) and b) a getmetatable call returns the __metatable value. The
__metatable field does not need to contain a table!
* __globals field: If the globals table of a function contains a
"__globals" field then the globals table is considered "protected". This
means that a) you cannot change the globals table of that function (through
setglobals) and b) a getglobals call returns the __globals value. The
__globals field does not need to contain a table!
Again, maybe these features were left undocumented because they are likely
to change??
Which reminds me: what is the status of the Lua Web Encyclopedia that was
proposed on this list recently? It would be an excellent place to collect
and document Lua's features.
Bye,
Wim