Set.st
branchjv
changeset 17734 406b1590afe8
parent 17711 39faaaf888b4
child 17735 6a5bc05f696a
--- a/Set.st	Mon Oct 26 21:51:17 2009 +0000
+++ b/Set.st	Thu Nov 05 14:41:30 2009 +0000
@@ -227,6 +227,19 @@
     "
      #(1 2 3 4 5 6 7) asSet copyWithoutAll:#(3 5 7 9)
     "
+!
+
+like:anObject
+    "Answer an object in the receiver that is equal to anObject,
+     nil if no such object is found. 
+     Relies heavily on hash properties (i.e. that two object's hashes are equal
+     if the two object compare equal)"
+
+    ^ self elementAt:anObject ifAbsent:[ nil ]
+
+    "
+     (Set withAll:#(10.0 20.0 30.0 40.0)) like:20
+    "
 ! !
 
 !Set methodsFor:'accessing'!
@@ -249,8 +262,7 @@
      This may seem confusing at first - however, it is useful with
      non-identitysets, to find an existing element, for a 
      given equal (but not identical) object.
-     This is the same functionality as provided by the goodies/KeyedSet
-     goody."
+     This is the same functionality as provided by the goodies/KeyedSet goody."
 
     ^ self elementAt:anObject ifAbsent:[^ self errorNotFound].
 
@@ -1121,7 +1133,12 @@
 !Set class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Set.st 10447 2009-06-14 13:09:55Z vranyj1 $'
+    ^ '$Id: Set.st 10477 2009-11-05 14:41:30Z vranyj1 $'
+!
+
+version_CVS
+    ^ '$Id: Set.st 10477 2009-11-05 14:41:30Z vranyj1 $'
 ! !
 
 Set initialize!
+