The Trunk: Collections-cmm.533.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-cmm.533.mcz

commits-2
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.533.mcz

==================== Summary ====================

Name: Collections-cmm.533
Author: cmm
Time: 7 September 2013, 12:08:00.54 pm
UUID: f2cabfdf-d828-4a01-a4c5-3080cce8f8cb
Ancestors: Collections-cmm.532

Safer compareSafely:.

=============== Diff against Collections-cmm.532 ===============

Item was changed:
  ----- Method: Number>>compareSafely: (in category '*collections') -----
  compareSafely: aNumber
+ ^ aNumber isNumber and: [ self < aNumber ]!
- "Override method to compare the receiver with aNumber to determine its position in a human-readable list without unnecessarily agitating proxies."
- ^ self < aNumber!

Item was changed:
  ----- Method: Object>>compareSafely: (in category '*collections') -----
+ compareSafely: anObject
- compareSafely: anObject
- "Compare the receiver to anObject to determine its position in a human-readable list without unnecessarily agitating proxies."
  ^ self class = anObject class
  ifTrue: [ self printString < anObject printString ]
  ifFalse: [ self class name < anObject class name ]!

Item was changed:
  ----- Method: String>>compareSafely: (in category '*collections') -----
  compareSafely: aString
+ ^ aString isString and: [ self < aString ]!
- "Compare the receiver to aString in a way that will not agitate proxies."
- ^ self < aString!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-cmm.533.mcz

Nicolas Cellier
But now Number and not Number, or String not String are unordered...

1 compareSafely: '2' -> false
'2' compareSafely: 1 -> false

Shouldn't it be ^aNumber isNumber ifTrue: [self < aNumber] ifFalse: [super compareSafely: aSymbol] ?


2013/9/7 <[hidden email]>
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.533.mcz

==================== Summary ====================

Name: Collections-cmm.533
Author: cmm
Time: 7 September 2013, 12:08:00.54 pm
UUID: f2cabfdf-d828-4a01-a4c5-3080cce8f8cb
Ancestors: Collections-cmm.532

Safer compareSafely:.

=============== Diff against Collections-cmm.532 ===============

Item was changed:
  ----- Method: Number>>compareSafely: (in category '*collections') -----
  compareSafely: aNumber
+       ^ aNumber isNumber and: [ self < aNumber ]!
-       "Override method to compare the receiver with aNumber to determine its position in a human-readable list without unnecessarily agitating proxies."
-       ^ self < aNumber!

Item was changed:
  ----- Method: Object>>compareSafely: (in category '*collections') -----
+ compareSafely: anObject
- compareSafely: anObject
-       "Compare the receiver to anObject to determine its position in a human-readable list without unnecessarily agitating proxies."
        ^ self class = anObject class
                ifTrue: [ self printString < anObject printString ]
                ifFalse: [ self class name < anObject class name ]!

Item was changed:
  ----- Method: String>>compareSafely: (in category '*collections') -----
  compareSafely: aString
+       ^ aString isString and: [ self < aString ]!
-       "Compare the receiver to aString in a way that will not agitate proxies."
-       ^ self < aString!