lua-users home
lua-l archive

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


On Thu, Jul 13, 2017 at 5:32 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> 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.

I'm not allowing v to be omitted, I'm allowing t to be omitted. The "if t is
nil" part of your response is exactly the problem: if t is omitted, it should
act as if it's nil, but currently it doesn't, instead raising an argument type
error.

Regards,
Nathaniel