[squeak-dev] Number readFrom: can we remove some "accidental" features

nicolas cellier ncellier at ifrance.com
Sun Aug 31 00:13:10 UTC 2008


Strangely, Squeak Number class>>#readfrom: used to accept non Smalltalk 
syntax like:
(Number readFrom: '.2') -> 0.2 .
(Number readFrom: '2.e3') -> 2000.0 .

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

Don't know if accidental or on purpose, but to me, this is wrong and I 
did not implement this behavior in SqNumberParser because there is no 
such official Smalltalk syntax to my knowledge.

Up to any one to accept an alternate number syntax by subclassing 
SqNumberParser.

Now I see that Dave Lewis (dtl) asserted this feature:

testAsNumberWithSuperfluousDecimalPoint
	| sd |
	sd _ '123.s2' asNumber.
	self assert: ScaledDecimal == sd class.
	self assert: sd scale == 2.
	self assert: '123.00s2' = sd printString.

I'd like to remove this feature.
Is it ok?




More information about the Squeak-dev mailing list