[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to extract a floating point number locale-independantly
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 28 Apr 2016 12:56:20 -0300
> On 26 April 2016 at 23:46, Daurnimator <firstname.lastname@example.org> 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:
> - 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
> - 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'.)