added #includesIdentical:
authorClaus Gittinger <cg@exept.de>
Thu, 02 Dec 1999 12:22:55 +0100
changeset 5049 d8279f59df21
parent 5048 b1e10ce753fd
child 5050 ea292b958108
added #includesIdentical:
Array.st
--- a/Array.st	Thu Dec 02 12:22:34 1999 +0100
+++ b/Array.st	Thu Dec 02 12:22:55 1999 +0100
@@ -2379,6 +2379,20 @@
     }
 %}.
     ^ false
+!
+
+includesIdentical:anObject
+    "return true, if the argument, anObject is contained in the array
+     uses #== (instead of #=) when comparing; i.e. the search is for
+     the object, not some object being equal."
+
+    ^ (self identityIndexOf:anObject) ~~ 0
+
+    "
+     #(1 2 3 4 5) includes:3.0
+
+     #(1 2 3 4 5) includesIdentical:3.0
+    "
 ! !
 
 !Array methodsFor:'tracing'!
@@ -2394,5 +2408,5 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.120 1999-09-04 18:14:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.121 1999-12-02 11:22:55 cg Exp $'
 ! !