lua-users home
lua-l archive

Re: [PATCH] setmetatable({}) causes error

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


> I noticed that setmetatable({}, nil) works normally, but setmetatable({})
> causes an argument type error. This patch fixes the error and restores
> expected behavior.
What is the expected behavior? The signature of setmetatable is
setmetatable(v,t); it sets the setmetatable of v to t or removes the
setmetatable of v if t is nil. Allowing v to be omitted is confusing.

AltStyle によって変換されたページ (->オリジナル) /