lua-users home
lua-l archive

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


> 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.