Mantis - Squeak
Viewing Issue Advanced Details
7050 Kernel minor always 05-16-08 10:56 05-25-08 18:35
0007050: String to Number conversion error
In Integer class>>readFrom:base:
conversion '.2' asNumber (String asNumber)
image 3.8.1 ->error
image 3.9 ->Float .2, but this fix is wrong (for example Color fromString: 'yellow' return Color black, because, this method expect error.

So I think bug is in every version.

I send you right solution [^] (49,311 bytes) 05-16-08 10:56
 Integer [^] (1,026 bytes) 05-17-08 17:43

05-17-08 04:30   
Hi zakletejTermix

Thanks for pointing out the inconsistancy.
Surely at least one version is in error.

Please describe what you think to be the correction.

The upload seems to be the intire Integer class, To file out specific methods you have to call up the menu in the method pane.
To file out a bunch of methods in the same catagory you need to file out from the catagory pane.

To pick and choose methods to file out you need to file them out from a change sorter (dual change sorters are the tool of choice since it lets you move methods from one change set to another.)

Off hand I would guess that 3.8.1 is right and 3.9 is wrong.

0.2 is a float .2 is an error or maybe even a poorly separted . 2 which would be 2

05-17-08 17:48   
Ok, I upload Integer class>readFrom:base:

And I think, that '.2' is correct string to conversion(why not?)
I'm doing new Scamper from CSS 2.1 specification and values as .2 are supported, so I must support this conversion
nicolas cellier   
05-25-08 18:35   
.2 used to be accepted (whether accidentally or on purpose?), but it should not, it is not a valid Smalltalk syntax.
A subclass of SqNumberParser could however parse this kind of Number (I have a FORTRAN Number Parser doing this).

If you load patches from 0006982 , then
  Integer readFrom: '.2'.
will (IMO correctly) raise an Error

Why do you think it is important to answer zero rather than raise an Error?