[squeak-dev] SqNumberParser!

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Mar 20 21:49:06 UTC 2009


Hi again

2009/3/20 Göran Krampe <goran at krampe.se>

> Howdy folks!
>
> In working on Tirade I stumbled upon SqNumberParser and its history:
>
> http://bugs.squeak.org/view.php?id=3512
>
> ...it was added to the image in 3.9 but not hooked into Scanner - Scanned
> still uses Number class>>readFrom:.
>
> Now... In Tirade I can use whichever - but using SqNumberParser makes it
> more correct, and quite faster - although "less portable" since I would
> depend on it. I will now make Tirade use SqNumberParser *if present* in the
> image, otherwise fall back on Number class>>readFrom:. This opens up some
> slight potential incompatibility issues, but whatever.
>
> Question: Is there anything stopping 3.9+ including Pharo to start using
> SqNumberParser from Scanner>>xDigit?
>
> And oh, the class name is not so good IMHO, why the Sq prefix?
>

The history starts here
http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-April/103137.html
I think Diego Fernandez first proposed to use a class for parsing Numbers,
but then Francisco Garau prepended a Sq (to emphasize Squeak peculiarities?)
and the name remained as is...
I am also equipped with a FORTRAN, a Dolphin and a VW Number parser, and
guess what ? Smalltalk syntax vary...
...But I agree, Squeak Academy should discuss new names entering in the
Smalltalk dictionary ;)


> And yeah, class var not used in SqNumberParser: BelllerophonBase10 :)


Yes remove it, it was used once in early days, before I correct conversions
Integer>>asFloat Fraction>>asFloat
(all started from here
http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-April/102465.html
)

There is more at:
http://bugs.squeak.org/view.php?id=7169
http://bugs.squeak.org/view.php?id=6779
http://bugs.squeak.org/view.php?id=7174
http://bugs.squeak.org/view.php?id=6976
http://bugs.squeak.org/view.php?id=6982


>
> regards, Göran
>
>
And still, one thing lacks, a proper NumberParserException...

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090320/1219ce0e/attachment.htm


More information about the Squeak-dev mailing list