<div dir="ltr"><div><div><div>But now Number and not Number, or String not String are unordered...<br><br></div>1 compareSafely: '2' -> false<br></div>'2' compareSafely: 1 -> false<br><br></div>Shouldn't it be ^aNumber isNumber ifTrue: [self < aNumber] ifFalse: [super compareSafely: aSymbol] ?<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/7 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Chris Muller uploaded a new version of Collections to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Collections-cmm.533.mcz" target="_blank">http://source.squeak.org/trunk/Collections-cmm.533.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-cmm.533<br>
Author: cmm<br>
Time: 7 September 2013, 12:08:00.54 pm<br>
UUID: f2cabfdf-d828-4a01-a4c5-3080cce8f8cb<br>
Ancestors: Collections-cmm.532<br>
<br>
Safer compareSafely:.<br>
<br>
=============== Diff against Collections-cmm.532 ===============<br>
<br>
Item was changed:<br>
----- Method: Number>>compareSafely: (in category '*collections') -----<br>
compareSafely: aNumber<br>
+ ^ aNumber isNumber and: [ self < aNumber ]!<br>
- "Override method to compare the receiver with aNumber to determine its position in a human-readable list without unnecessarily agitating proxies."<br>
- ^ self < aNumber!<br>
<br>
Item was changed:<br>
----- Method: Object>>compareSafely: (in category '*collections') -----<br>
+ compareSafely: anObject<br>
- compareSafely: anObject<br>
- "Compare the receiver to anObject to determine its position in a human-readable list without unnecessarily agitating proxies."<br>
^ self class = anObject class<br>
ifTrue: [ self printString < anObject printString ]<br>
ifFalse: [ self class name < anObject class name ]!<br>
<br>
Item was changed:<br>
----- Method: String>>compareSafely: (in category '*collections') -----<br>
compareSafely: aString<br>
+ ^ aString isString and: [ self < aString ]!<br>
- "Compare the receiver to aString in a way that will not agitate proxies."<br>
- ^ self < aString!<br>
<br>
<br>
</blockquote></div><br></div>