[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Custom type methods (and name)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 19 Feb 2016 08:04:11 -0200
> Under Lua 5.3.2 with Luiz's complex, I get:
>
> > z=complex.new(0,1); pairs(z)
> stdin:1: bad argument #1 to 'pairs' (table expected, got complex number)
>
> So I can't reproduce your result.
>
> The manual says only:
>
> The entry __name is used by some error-reporting functions.
__name support was introduced in Lua 5.3: luaL_newmetatable sets it,
which automatically gives all libraries nicer error messages.
The OP is using Lua 5.1.