2014-02-26 23:08 GMT+01:00 Nicolas Cellier <[hidden email]>:
That's exactly for this kind of reasons that I developped an ExtendedNumberParser connected to Number class>>readFrom:, to allow a variety of formats used in the rest of the world.
It would have been easy to allow upper letter exponents in this parser, but the class was considered superfluous and removed from Pharo 3.0...
super easy is just redefine:
ExtendedNumberParser>>exponentLetters
^'edqEDQ'
and then Float readFrom: '1.0000000000000000E-02' works as expected, that is in Squeak at least...
Re: Fwd: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone
2014-02-26 23:38 GMT+01:00 Tobias Pape <[hidden email]>:
Can we get this into trunk please?
Ie,
SqNumberPasrser>>exponentLetters
"current comment"
^'edqEDQ'
Best
-Tobias
You mean modifying Smalltalk syntax?
That's a possible option, and it would work in Pharo too. Note that 1.0E2 was previously interpreted as send #E2 to 1.0, so it might change...
...not much thing : the problem is highly hypothetical, we don't use a leading uppercase letter in selectors usually, and we also put a space before a unary or keyword message - one rare exception I encountered was Complex "constants" like 1+2i ...
2014-02-26 23:08 GMT+01:00 Nicolas Cellier <[hidden email]>:
That's exactly for this kind of reasons that I developped an ExtendedNumberParser connected to Number class>>readFrom:, to allow a variety of formats used in the rest of the world.
It would have been easy to allow upper letter exponents in this parser, but the class was considered superfluous and removed from Pharo 3.0...
super easy is just redefine:
ExtendedNumberParser>>exponentLetters
^'edqEDQ'
and then Float readFrom: '1.0000000000000000E-02' works as expected, that is in Squeak at least...