Bug in Shout number parsing

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

Bug in Shout number parsing

Bert Freudenberg
Shout parses integers with exponent incorrectly:

        1e3

        2r1e7

It treats the exponent part as message send.

Same for non-decimal floats:

        2r1.1

The decimal point is parsed as binary message.

And scaled decimals with radix are affected, too:

        2r1s3

        2r1.1s3

Granted, most people aren't aware of Smalltalks powerful number  
literals, but they are supported and sometimes even used (see, e.g.,  
CornerRounder class>>initialize where I noticed the Shout problem).

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Bug in Shout number parsing

Klaus D. Witzel
On Sun, 04 Mar 2007 12:43:01 +0100, Bert Freudenberg wrote:

> Shout parses integers with exponent incorrectly:
>
> 1e3
>
> 2r1e7
>
> It treats the exponent part as message send.
>
> Same for non-decimal floats:
>
> 2r1.1
>
> The decimal point is parsed as binary message.
>
> And scaled decimals with radix are affected, too:
>
> 2r1s3
>
> 2r1.1s3
>
> Granted, most people aren't aware of Smalltalks powerful number  
> literals, but they are supported and sometimes even used (see, e.g.,  
> CornerRounder class>>initialize where I noticed the Shout problem).

... and NumberTest>>#testReadFrom which I reported to Andy maaany months  
ago ;-)

/Klaus

> - Bert -
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Bug in Shout number parsing

Andrew Tween
In reply to this post by Bert Freudenberg
Hi Bert,
> Shout parses integers with exponent incorrectly:
>
> 1e3

Thanks. That needs a fix.

However, I believe that the latest version on SqueakMap
(Shout.3.15-tween.66.mcz), includes fixes for all the other examples below...

> 2r1e7
> 2r1.1
> 2r1s3
> 2r1.1s3

Incidently, I had previously created some unit tests (ShoutTests-tween.8.mcz on
squeaksource), for checking the number parsing. This should make fixing the 1e3
problem, without breaking everything else, much easier.

Andy


Reply | Threaded
Open this post in threaded view
|

Re: Bug in Shout number parsing

Andrew Tween
In reply to this post by Klaus D. Witzel
Hi Klaus,
> ... and NumberTest>>#testReadFrom which I reported to Andy maaany months
> ago ;-)

I remember that, and I also remember doing some fixes :-;

Those examples should also be ok with the latest SqueakMap release.

I am beginning to suspect that I may have forgotten to announce the last
SqueakMap release, and that many people are still using an older version :(

Cheers,
Andy


Reply | Threaded
Open this post in threaded view
|

Re: Bug in Shout number parsing

Klaus D. Witzel
Hi Andy, you wrote:

> Hi Klaus,
>> ... and NumberTest>>#testReadFrom which I reported to Andy maaany months
>> ago ;-)
>
> I remember that, and I also remember doing some fixes :-;
>
> Those examples should also be ok with the latest SqueakMap release.
>
> I am beginning to suspect that I may have forgotten to announce the last
> SqueakMap release, and that many people are still using an older version  
> :(

I'm using the Squeak-dev #83 .image and that has Shout.3.15-tween.65 as  
latest. Damien?

After loading Shout.3.15-tween.66, 2r1e26 is now colored correctly in  
#testReadFrom. Also, CornerRounder class>>initialize looks nice.

Thank you Andy.

/Klaus

> Cheers,
> Andy
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Bug in Shout number parsing

Damien Cassou-3
2007/3/4, Klaus D. Witzel <[hidden email]>:
> I'm using the Squeak-dev #83 .image and that has Shout.3.15-tween.65 as
> latest. Damien?

Future squeak-dev images will contain new shout. In the future, new
shout versions should be detected automatically.

Currently, you can update Shout executing:

(DEVMonticello squeakSourceDirectory: 'shout' packageName:
'Shout.3.15-tween') install

or Monticello directly.

Bye

--
Damien Cassou