On 26 Feb 2014, at 23:08, Nicolas Cellier <nicolas.cellier.aka.n...@gmail.com> 
wrote:

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

Nicolas

to explain a bit the removal of that class. I do not think that Java has three 
different parser for number in its core or ruby?
From a maintenance perspective this is a lot of stress on us (not only at the 
code level the conceptually).
If we do not have a guy like you taking care of such issues in Pharo daily how 
can we continue maintaining different parser?
This is why we should simplifiy. 
Why this is the not the job of a GemstoneToPharoPharo to do that? Or 
ExternalNumberParser (to me it if conceptually different than 
ExtendedNumberParser) and it should be packaged somewhere else. We got at least 
two ASTs, three parsers and this cannot be. 

Stef


> 
> 
> 2014-02-26 22:38 GMT+01:00 Mariano Martinez Peck <marianop...@gmail.com>:
> Hi guys,
> 
> When I export SmallDoubles with SIXX in GemStone it generates something like 
> this:
> 
> <sixx.object sixx.id="15" sixx.name="close" sixx.type="SmallDouble" 
> >1.0000000000000000E-02</sixx.object>
> 
> This is because "0.01 asString" -> '1.0000000000000000E-02'
> 
> 
> 
> Then I want to load this in Pharo. So first problem is that of course 
> SmallDouble doesn't exist. So I did:
> 
> 
> 
> aSixxShapeChangeStream shapeChangers at: #SmallDouble put: Float.
>       
> But then, SIXX use Float >> readFrom: aStream 
>       "Answer a new Float as described on the stream, aStream."
> 
>       ^(super readFrom: aStream) asFloat
> 
> 
> So, of course " Float readFrom: '1.0000000000000000E-02'  "  ->  1.0
> 
> So my 0.01 in gemstone become 1.0 in Pharo....
> 
> Am I doing something wrong or this is expected? What is the best workaround?
> 
> In GemStone I could print the SmallDouble in the XML with a method like
> 
> Float >> xmlRepresentation
> ^ String streamContents:
>               [:strm | self printOn: strm base: 10]
> 
> Is this the correct approach? If true, I guess I should define:
> 
> Float >> sixxContentOn: aStream indent: level context: dictionary
>       aStream nextPutAll: self xmlRepresentation
> 
>       
> Thoughts?
> 
> Thanks in advance,
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com
> 

Reply via email to