[squeakdev] The Trunk: Kernelnice.404.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Feb 23 14:14:53 UTC 2010
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernelnice.404.mcz
==================== Summary ====================
Name: Kernelnice.404
Author: nice
Time: 23 February 2010, 3:14:34.835 pm
UUID: 602205a329f592409436c42070a48cea
Ancestors: Kernelnice.403
Connect ExtendedNumberParser in Number class>>#readFrom: and some variants
Current behavior is:
'' asNumber > Error (used to be 0)
'1.' asNumber > 1.0 (used to be 1)
'1.e2' asNumber > 100.0
'1.e+2' asNumber > 100.0 (NEW)
'+1' asNumber > 1 (NEW)
OLD weird squeak behaviour preserved for sign position:
'16rFF' asNumber >255
'16rFF' asNumber >255
16rFF' asNumber > 255
(NOW has same with +)
These ones used to fail:
'1r0' asNumber > 1 (ignore the rest from $r to end)
'2r3' asNumber > 2 (ignore the rest from $r to end)
Changes due to 16rff from Andreas
'16r1.e2' asNumber > 1.8828125 (used to be 4096.0)
Now time to raise your voice...
=============== Diff against Kernelnice.403 ===============
Item was changed:
 Method: Integer class>>readFrom:ifFail: (in category 'instance creation') 
readFrom: aStringOrStream ifFail: aBlock
"Answer an instance of one of the concrete subclasses if Integer.
+ Initial plus or minus sign accepted.
+ Imbedded radix specifiers not allowed; use Number class readFrom: for that.
 Initial minus sign accepted.
 Imbedded radix specifiers not allowed; use Number
 class readFrom: for that.
Execute aBlock if there are no digits."
+ ^(ExtendedNumberParser on: aStringOrStream) nextIntegerBase: 10 ifFail: aBlock!
 ^(SqNumberParser on: aStringOrStream) nextIntegerBase: 10 ifFail: aBlock!
Item was changed:
 Method: Number class>>readFrom: (in category 'instance creation') 
readFrom: stringOrStream
"Answer a number as described on aStream. The number may
be any accepted Smalltalk literal Number format.
It can include a leading radix specification, as in 16rFADE.
It can as well be NaN, Infinity or Infinity for conveniency.
If stringOrStream does not start with a valid number description, fail."
+ ^(ExtendedNumberParser on: stringOrStream) nextNumber!
 ^(SqNumberParser on: stringOrStream) nextNumber!
Item was changed:
 Method: Number class>>readFrom:ifFail: (in category 'instance creation') 
readFrom: stringOrStream ifFail: aBlock
"Answer a number as described on aStream. The number may
be any accepted Smalltalk literal Number format.
It can include a leading radix specification, as in 16rFADE.
It can as well be NaN, Infinity or Infinity for conveniency.
If input does not represent a valid number, then execute fail block
and leave the stream positioned before offending character"
+ ^(ExtendedNumberParser on: stringOrStream) failBlock: aBlock; nextNumber!
 ^(SqNumberParser on: stringOrStream) failBlock: aBlock; nextNumber!
Item was changed:
 Method: Integer class>>readFrom:base: (in category 'instance creation') 
readFrom: aStringOrStream base: base
"Answer an instance of one of the concrete subclasses if Integer.
+ Initial plus or minus sign accepted, and bases > 10 use letters AZ.
+ Imbedded radix specifiers not allowed; use Number class readFrom: for that.
 Initial minus sign accepted, and bases > 10 use letters AZ.
 Imbedded radix specifiers not allowed; use Number
 class readFrom: for that.
Raise an Error if there are no digits."
+ ^(ExtendedNumberParser on: aStringOrStream) nextIntegerBase: base!
 ^(SqNumberParser on: aStringOrStream) nextIntegerBase: base!
Item was removed:
  Method: Number class>>readExactlyFrom: (in category 'instance creation') 
 readExactlyFrom: stringOrStream
 "Answer a number as described on aStream. The number may
 include a leading radix specification, as in 16rFADE"

 ^(SqNumberParser on: stringOrStream) nextNumber!
More information about the Squeakdev
mailing list
