[Glass] MAStringReader>>visitNumberDescription broken?

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Tue Sep 8 07:27:35 PDT 2015


On Tue, Sep 8, 2015 at 6:50 AM, Iwan Vosloo via Glass <
glass at lists.gemtalksystems.com> wrote:

> On 07/09/2015 16:56, Dale Henrichs via Glass wrote:
>
>> It turns out that in the GemStone/GsDevKit version of NumberParser
>> (actually SqNumberParser), isNumber: is not implemented ... was there a
>> major rewrite of NumberParser in Pharo4.0 (it's not in Pharo3.0 either) or
>> is it a simple extension method?
>>
>> I might be able to squeeze out some time and take a bigger look at this
>> one:)
>>
>
> From what I can see, Magritte-Model adds isNumber in the Pharo and
> GemStone case. The real problem is perhaps how isNumber: is implemented OR
> perhaps the implementation of parse:onError: which it sends.
>
>
Hi guys,

This is not 100% same topic, but wanted to say it in case we fix both.
Unfortunately, I cannot remember what was broken, and I did not even wrote
a comment....but as part of my sad "overrides" in GemStone, I have an
override of Integer >> #readFrom:

Integer >> readFrom: aStringOrStream
"Answer a new Integer as described on the stream, aStream.
Embedded radix specifiers not allowed - use Number readFrom: for that."
^self readFrom: aStringOrStream base: 10
And I had to override it like this:

Integer >> faReadFrom: aStream ^ (SqNumberParser on: aStream)
nextIntegerBase: 10


And I have to also change:

SqNumberParser class >> on: aStringOrStream
^ExtendedNumberParser new on: aStringOrStream

SqNumberParser >> exponentLetters
"answer the list of possible exponents for Numbers.
Note: this parser will not honour precision attached to the exponent.
different exponent do not lead to different precisions.
only IEEE 754 floating point numbers will be created"
^'edqEDQ'


Regards
> - Iwan
>
> --
> Reahl, the Python only web framework: http://www.reahl.org
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150908/c2a6c09c/attachment-0001.html>


More information about the Glass mailing list