Difference between revisions of "Setmetatable"
From OpenEUO
(Created page with " setmetatable (table, metatable) Sets the metatable for the given table. (You cannot change the metatable of other types from Lua, only from C.) If metatable is nil, removes the...") |
|||
Line 4: | Line 4: | ||
This function returns table. | This function returns table. | ||
+ | |||
+ | [http://www.lua.org/manual/5.1/manual.html#2.8 Lua Manual - Metatables] |
Revision as of 17:22, 7 October 2010
setmetatable (table, metatable)
Sets the metatable for the given table. (You cannot change the metatable of other types from Lua, only from C.) If metatable is nil, removes the metatable of the given table. If the original metatable has a "__metatable" field, raises an error.
This function returns table.