Collection.st
changeset 17554 e85acbe69361
parent 17409 987cd6ce6d2e
child 17572 2e3cc2277c96
--- a/Collection.st	Wed Feb 25 14:09:36 2015 +0100
+++ b/Collection.st	Wed Feb 25 14:12:31 2015 +0100
@@ -344,7 +344,6 @@
     ^ self == Collection
 ! !
 
-
 !Collection methodsFor:'Compatibility-Dolphin'!
 
 identityIncludes:anObject
@@ -539,14 +538,18 @@
 
 anElement
     "return any element from the collection, 
-     report an error if there is none"
+     report an error if there is none.
+     Use this to fetch the some element from a collection which is non-indexed or which
+     has a non-numeric index. I.e. if someone gets an arbitrary collection which might be either indexable
+     or not, anElement is a save way to access some element without a need to check for a proper key."
 
     self do: [:each | ^ each].
     self emptyCollectionError.
 
     "
-     #() anElement       -> Error
-     #(1 2 3) anElement  -> 1
+     #() anElement             -> Error
+     #(1 2 3) anElement        -> 1
+     #(1 2 3) asSet anElement  -> one of them (undefined, which one)
     "
 !
 
@@ -5696,11 +5699,11 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.357 2015-02-04 19:58:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.358 2015-02-25 13:12:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.357 2015-02-04 19:58:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.358 2015-02-25 13:12:31 cg Exp $'
 ! !