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! |
But now Number and not Number, or String not String are unordered... 1 compareSafely: '2' -> false2013/9/7 <[hidden email]> Chris Muller uploaded a new version of Collections to project The Trunk: |
Free forum by Nabble | Edit this page |