[Glass] MAStringReader>>visitNumberDescription broken?

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Tue Sep 8 12:56:54 PDT 2015


Mariano,

Could you submit an issue on this [1]? I would like a little more detail 
on the circumstances for needing to use ExtendedNumberParser 
(unconditionally) instead of SqNumberParser ... the other two cases, I 
think I understand ...

As always a pull request will be integrated into the release much 
quicker than waiting for me to get around to dealing with the issue:)

Dale

[1] https://github.com/GsDevKit/GsDevKit/issues

On 09/08/2015 07:27 AM, Mariano Martinez Peck via Glass wrote:
>
>
> On Tue, Sep 8, 2015 at 6:50 AM, Iwan Vosloo via Glass 
> <glass at lists.gemtalksystems.com 
> <mailto: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 <mailto:Glass at lists.gemtalksystems.com>
>     http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150908/625219a0/attachment.html>


More information about the Glass mailing list