lua-users home
lua-l archive

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


> Date: Mon, 28 Jul 2014 12:32:28 -0700
> From: chighland@gmail.com
> To: lua-l@lists.lua.org
> Subject: Re: Are automatic coercions ever going away?
>
> On Mon, Jul 28, 2014 at 12:15 PM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
> >> It sits rather deeply in the implementation. [...]
> >> it is so troublesome that it has not been done yet
> >
> > Not really. See http://lua-users.org/lists/lua-l/2014-03/msg00699.html
> >
>
> Breaking tonumber() isn't exactly the same thing as removing implicit
> coercions -- it breaks explicit conversions too.

I'm not sure why no one pointed this out before, but the change referenced there doesn't break tonumber. The implementation of tonumber() is http://www.lua.org/source/5.2/lbaselib.c.html#luaB_tonumber

More over, the lua library functions are written using the standard lua api without access to any internals. That means that changing the internals relating to conversions doesn't imply that the library functions are broken.