Fwd: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone

Tobias Pape
Can we get this into trunk please?
Ie,

SqNumberPasrser>>exponentLetters
   "current comment"
   ^'edqEDQ'


Best
-Tobias

Begin forwarded message:

From: Nicolas Cellier <[hidden email]>
Subject: Re: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone
Date: 26. Februar 2014 23:14:10 MEZ
To: Pharo Development List <[hidden email]>
Reply-To: Pharo Development List <[hidden email]>




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...





signature.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone

Nicolas Cellier



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 ...

Begin forwarded message:

From: Nicolas Cellier <[hidden email]>
Subject: Re: [Pharo-dev] Floats problem with SIXX between Pharo and GemStone
Date: 26. Februar 2014 23:14:10 MEZ
To: Pharo Development List <[hidden email]>
Reply-To: Pharo Development List <[hidden email]>




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...