lua-users home
lua-l archive

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


On Thu, Sep 13, 2012 at 6:38 PM, Norfanin <norfanin@gmail.com> wrote:
> This reads as if the functions should not convert at all and always raise an
> error instead. A note in the manual about this conversion could help developers
> to be more aware of this behaviour.

Its a gotcha, but its noted all over the place in the manual that in
lua numbers and strings implicitly convert to each other. I don't
think mentioning it in every function that uses lua_tostring() or
lua_tonumber() is reasonable.

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> = 5 + "6"
11
> = "7" .. 8
78
>