lua-users home
lua-l archive

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


> I can work around this by calling lua_type instead of lua_isnumber, but
it
> doesn't seem right that lua_isnumber should modify the variable it is
> testing - is this behaviour correct?

Yes, it is "correct" and it is documented.

The idea is that most functions which are looking for a number would like
to use the Lua coercion protocol, so lua_isnumber implements that. Calling
lua_type is the indicated solution.