[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lstrlib.c initialization - why createmetatable?
- From: Duncan Cross <duncan.cross@...>
- Date: Sun, 18 Apr 2010 23:09:24 +0100
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