lua-users home
lua-l archive

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


> On 26 April 2016 at 23:46, Daurnimator <quae@daurnimator.com> wrote:
> >> Two is dubious; this "fix" may affect people that count on this
> >> behavior.
> >
> > I do agree others might be relying on this. This may mean it can't be
> > fixed until 5.4.
> 
> I'm pondering if this is okay to make it into a "bugfix" release:
> 
> For:
>   - the documented behaviour is closer to the new behaviour than the
> current behaviour
>   - luajit embeds it's own strtod that doesn't care about the locale;
> and hence has the proposed behaviour already.
>   - fix existing code that is currently broken in non-C locales
> 
> Against:
>   - lua will have a new deficiency: no way to parse a number in the
> current locale.
>   - could break existing code

Maybe a nice compromisse would be to accept both the locale point and
dots everywhere, except in the lexer.

(Just for the record, "everywhere" means coercions from strings
to numbers, 'tonumber', 'io.read("n")', and 'lua_stringtonumber'.)

-- Roberto