Thanks Vassili.
John Treble
Ottawa, Ontario, Canada
-----Original Message-----
From: Vassili Bykov [mailto:
[hidden email]]
Sent: April 10, 2006 1:00 PM
To:
[hidden email]
Cc:
[hidden email]
Subject: Re: QUES: 'abc' asNumber => 0 ?
John Treble wrote:
>
> Why does VW 7.4 return 0 for expressions like:
> 'abc' asNumber
> '&$#' asNumber...
>
> I was expecting an error (which is what I get using Dolphin 6 and Squeak
> 3.7). Thanks.
For historical reasons. This is how that method (or rather Number
class>>readFrom: that does the real work) was defined in Smalltalk-80
when there were no real exceptions. Fixing something like this is not
easy with 20 years' worth of customer code potentially relying on quirky
behavior.
--
Vassili Bykov <
[hidden email]>
[:s | s, s printString] value: '[s: | s, s printString] value: '