lua-users home
lua-l archive

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


On Sun, Apr 18, 2010 at 10:35 PM, HyperHacker <hyperhacker@gmail.com> wrote:
> I'm curious though why you didn't just clear the whole table, i.e.
> setmetatable("a", nil)

setmetatable() won't let you set the metatable of anything except
tables. You can use debug.setmetatable() instead, of course, which
doesn't have this restriction - but as a debug library function, using
it in normal code is usually discouraged.

-Duncan