IdentitySet.st
changeset 23695 59ae587a1107
parent 22498 f5e8366a9fe5
child 23839 fadefe4a762e
--- a/IdentitySet.st	Sun Feb 10 14:43:52 2019 +0100
+++ b/IdentitySet.st	Sun Feb 10 14:43:57 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -283,31 +281,7 @@
     "Created: 19.3.1997 / 15:18:59 / cg"
 ! !
 
-!IdentitySet methodsFor:'set operations'!
-
-\ aCollection
-    "return a new set containing all elements of the receiver, 
-     which are NOT also contained in the aCollection
-     For large collections you better use a Set for aCollection.
-     Redefined here to do identity comparison."
-
-    |newCollection|
-
-    newCollection := self speciesForAdding new.
-    self do:[:element |
-        (aCollection includesIdentical:element) ifFalse:[
-            newCollection add:element
-        ]
-    ].
-    ^ newCollection
-
-    "
-     #(0 1 2 3 4 5 6 7 8 9) asIdentitySet \ #(1 2 3) asSet  
-     #(0 1 2 3 4 5 6 7 8 9) asIdentitySet \ #(1 2 3)
-    "
-! !
-
-!IdentitySet methodsFor:'testing'!
+!IdentitySet methodsFor:'queries'!
 
 identicalContentsAs:aCollection
     "return true if the receiver and aCollection represent collections
@@ -336,6 +310,30 @@
     "Created: / 11.12.1998 / 20:01:12 / cg"
 ! !
 
+!IdentitySet methodsFor:'set operations'!
+
+\ aCollection
+    "return a new set containing all elements of the receiver, 
+     which are NOT also contained in the aCollection
+     For large collections you better use a Set for aCollection.
+     Redefined here to do identity comparison."
+
+    |newCollection|
+
+    newCollection := self speciesForAdding new.
+    self do:[:element |
+        (aCollection includesIdentical:element) ifFalse:[
+            newCollection add:element
+        ]
+    ].
+    ^ newCollection
+
+    "
+     #(0 1 2 3 4 5 6 7 8 9) asIdentitySet \ #(1 2 3) asSet  
+     #(0 1 2 3 4 5 6 7 8 9) asIdentitySet \ #(1 2 3)
+    "
+! !
+
 !IdentitySet class methodsFor:'documentation'!
 
 version