[squeak-dev] Bug in Number parsing?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Aug 12 08:26:25 UTC 2011


For the sake of it, I would say things are not worse than before I put
my big nose in the code:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-April/103137.html

Nicolas

2011/8/12 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> This was changed in:
>
> The Trunk: Compiler-nice.125.mcz
> The Trunk: Kernel-nice.404.mcz
>
> The rationale is that (Number readFrom: ) is a very poor way to report
> a syntax error in the number.
> SqNumberParser can do much better when invoked with ad hoc API.
>
> This release the necessity for Number>>readFrom: to strictly adhere to
> Smalltalk syntax (which it did not since it also interprets infinity
> and nan).
>
> Nicolas
>
> 2011/8/12 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
>> Yes, in Squeak this behavior is obtained with the ExtendedNumberParser.
>> You can read these floats for example:
>>
>> 1.
>> 1.e+30
>> .1
>> -.1e+30
>>
>> Though, in Smalltalk source code, the SqNumberParser is used and you can't.
>>
>> Nicolas
>>
>> 2011/8/12 Frank Shearar <frank.shearar at gmail.com>:
>>> Hi,
>>>
>>> While playing around, I've found that Number readFrom: '1.' returns
>>> 1.0 ... I'd expected a 1.
>>>
>>> Is this expected behaviour?
>>>
>>> frank
>>>
>>>
>>
>



More information about the Squeak-dev mailing list