<div dir="ltr">ASCII between 0 and 127 rather than 128 ?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/6  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</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.531.mcz" target="_blank">http://source.squeak.org/trunk/Collections-cmm.531.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-cmm.531<br>
Author: cmm<br>
Time: 6 September 2013, 2:26:33.695 pm<br>
UUID: da0031c2-e1d3-4f49-a425-9808728e3f1a<br>
Ancestors: Collections-ul.530<br>
<br>
- Remove redundant isVariableBinding override.<br>
- Characters can now be tested for isAscii.<br>
- Dictionary&#39;s and Set&#39;s made proxy-friendly.<br>
- Remove redundant isLiteral override.<br>
- Allow #asMutator to work for getter or setter selectors.<br>
<br>
=============== Diff against Collections-ul.530 ===============<br>
<br>
Item was removed:<br>
- ----- Method: Association&gt;&gt;isVariableBinding (in category &#39;testing&#39;) -----<br>
- isVariableBinding<br>
-       &quot;Return true if I represent a literal variable binding&quot;<br>
-       ^true!<br>
<br>
Item was added:<br>
+ ----- Method: Character&gt;&gt;isAscii (in category &#39;testing&#39;) -----<br>
+ isAscii<br>
+       ^ value between: 0 and: 128!<br>
<br>
Item was changed:<br>
  ----- Method: Dictionary&gt;&gt;keysSortedSafely (in category &#39;accessing&#39;) -----<br>
  keysSortedSafely<br>
        &quot;Answer a sorted Array containing the receiver&#39;s keys.&quot;<br>
+       ^ self keys sort:<br>
+               [ : x : y | x compareSafely: y ]!<br>
-<br>
-        ^self keys sort: [ :x :y |<br>
-               &quot;Should really be use &lt;obj, string, num&gt; compareSafely...&quot;<br>
-               ((x isString and: [ y isString ])<br>
-                       or: [ x isNumber and: [ y isNumber ] ])<br>
-                       ifTrue: [ x &lt; y ]<br>
-                       ifFalse: [ x class == y class<br>
-                               ifTrue: [ x printString &lt; y printString ]<br>
-                               ifFalse: [ x class name &lt; y class name ] ] ].<br>
- !<br>
<br>
Item was changed:<br>
  ----- Method: Dictionary&gt;&gt;scanFor: (in category &#39;private&#39;) -----<br>
  scanFor: anObject<br>
        &quot;Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or raise an error if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements.&quot;<br>

<br>
        | index start |<br>
        index := start := anObject hash \\ array size + 1.<br>
        [<br>
                | element |<br>
+               ((element := array at: index) == nil or: [ anObject = element key ])<br>
-               ((element := array at: index) == nil or: [ element key = anObject ])<br>
                        ifTrue: [ ^index ].<br>
                (index := index \\ array size + 1) = start ] whileFalse.<br>
        self errorNoFreeSpace!<br>
<br>
Item was added:<br>
+ ----- Method: Number&gt;&gt;compareSafely: (in category &#39;*collections&#39;) -----<br>
+ compareSafely: aNumber<br>
+       &quot;Override method to compare the receiver with aNumber to determine its position in a human-readable list without unnecessarily agitating proxies.&quot;<br>
+       ^ self &lt; aNumber!<br>
<br>
Item was added:<br>
+ ----- Method: Object&gt;&gt;compareSafely: (in category &#39;*collections&#39;) -----<br>
+ compareSafely: anObject<br>
+       &quot;Compare the receiver to anObject to determine its position in a human-readable list without unnecessarily agitating proxies.&quot;<br>
+       ^ self class = anObject class<br>
+               ifTrue: [ self printString &lt; anObject printString ]<br>
+               ifFalse: [ self class name &lt; anObject class name ]!<br>
<br>
Item was changed:<br>
  ----- Method: Set&gt;&gt;scanFor: (in category &#39;private&#39;) -----<br>
  scanFor: anObject<br>
        &quot;Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or raise an error if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements.&quot;<br>

<br>
        | index start |<br>
        index := start := anObject hash \\ array size + 1.<br>
        [<br>
                | element |<br>
+               ((element := array at: index) == nil or: [ anObject = element enclosedSetElement ])<br>
-               ((element := array at: index) == nil or: [ element enclosedSetElement = anObject ])<br>
                        ifTrue: [ ^index ].<br>
                (index := index \\ array size + 1) = start ] whileFalse.<br>
        self errorNoFreeSpace!<br>
<br>
Item was added:<br>
+ ----- Method: String&gt;&gt;asAscii (in category &#39;converting&#39;) -----<br>
+ asAscii<br>
+       ^ self select: [ : each | each isAscii ]!<br>
<br>
Item was added:<br>
+ ----- Method: String&gt;&gt;compareSafely: (in category &#39;*collections&#39;) -----<br>
+ compareSafely: aString<br>
+       &quot;Compare the receiver to aString in a way that will not agitate proxies.&quot;<br>
+       ^ self &lt; aString!<br>
<br>
Item was changed:<br>
+ ----- Method: String&gt;&gt;isLiteral (in category &#39;testing&#39;) -----<br>
- ----- Method: String&gt;&gt;isLiteral (in category &#39;printing&#39;) -----<br>
  isLiteral<br>
+       &quot;Answer whether the receiver is a valid Smalltalk literal.&quot;<br>
<br>
+       ^ true!<br>
-       ^true!<br>
<br>
Item was changed:<br>
  ----- Method: Symbol&gt;&gt;asMutator (in category &#39;converting&#39;) -----<br>
  asMutator<br>
+       &quot;Return a setter message from a getter message. For example, #name asMutator returns #name:&quot;<br>
+       ^ self last = $:<br>
+               ifTrue: [ self ]<br>
+               ifFalse: [ (self copyWith: $:) asSymbol ]!<br>
-       &quot;Return a setter message from a getter message. For example,<br>
-       #name asMutator returns #name:&quot;<br>
-       ^ (self copyWith: $:) asSymbol!<br>
<br>
Item was removed:<br>
- ----- Method: Symbol&gt;&gt;isLiteral (in category &#39;testing&#39;) -----<br>
- isLiteral<br>
-       &quot;Answer whether the receiver is a valid Smalltalk literal.&quot;<br>
-<br>
-       ^ true!<br>
<br>
Item was added:<br>
+ ----- Method: Symbol&gt;&gt;veryDeepCopy (in category &#39;copying&#39;) -----<br>
+ veryDeepCopy<br>
+       &quot;Overridden for performance.&quot;<br>
+       ^ self!<br>
<br>
<br>
</blockquote></div><br></div>