[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available
- From: Ico <lua@...>
- Date: Sun, 23 Mar 2014 20:53:09 +0100
* On 2014-03-23 20:40:24 +0100, Roberto Ierusalimschy wrote:
> I think it is really easy to disable this coercion in Lua; all it takes
> is a simple change in lvm.c (see below). It would be very helpful if
> people try that in the wild and report their experiences here in the
> list.
>
> Lua 5.1 and Lua 5.2:
> @@ -35,10 +35,6 @@
> const TValue *luaV_tonumber (const TValue *obj, TValue *n) {
> lua_Number num;
> if (ttisnumber(obj)) return obj;
> - if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) {
> - setnvalue(n, num);
> - return n;
> - }
> else
> return NULL;
> }
I guess an explicit conversion from string to number is still supposed
to work? With the above patch on 5.2:
=tonumber("3")
nil
--
:wq
^X^Cy^K^X^C^C^C^C