'3foo' asInteger probably should fail, because there is no stream to be tested 
for #atEnd.  Reading '3foo' from a stream *probably* should be ok by default, 
becauuse the stream will clearly not be a the end, one could easily want to 
read integers out of formatted strings.




________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Johan Brichau 
[[email protected]]
Sent: Thursday, August 26, 2010 8:43 AM
To: [email protected]
Subject: Re: [Pharo-project] String to Number conversion

On 25 Aug 2010, at 09:26, Stéphane Ducasse wrote:

>> Did you mean to let the dirty stuff to #squeezeOutNumber and throw the error 
>> in the #readFrom:?
>
> Yes. Now we should identify user of readFrom: that in fact are expecting 
> squeezeOutNumber and fix them.

Well, it seems that the current readFrom: only requires the string to _start_ 
with a valid format. This means that:

'3foo' asInteger = 3

Should we not fail here too? What are the opinions?

Johan
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to