[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tonumber() inconsistent behavior
- From: Dirk Feytons <dirk.feytons@...>
- Date: Tue, 26 Jul 2011 10:57:01 +0200
On Tue, Jul 26, 2011 at 10:50, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Tue, Jul 26, 2011 at 10:46 AM, Dirk Feytons <dirk.feytons@gmail.com> wrote:
>> Is there a specific reason why the behavior is different when a
>> non-default base is given?
>
> Hard to think why they must behave in such different ways. Especially
> since tonumber({},10) doesn't throw an error - so the behaviour
> depends on a parameter, not on the form.
Indeed, and I can see in the underlying implementation the root cause
of the difference in behavior: luaL_checkany() + lua_isnumber() +
lua_tonumber() versus luaL_checklstring().
--
Dirk