--- a/Collection.st Mon May 26 16:04:32 1997 +0200
+++ b/Collection.st Mon May 26 17:39:16 1997 +0200
@@ -830,6 +830,21 @@
^ true
!
+contains:aBlock
+ "evaluate aBlock for each of the receiver's elements.
+ Return true, if aBlock ever returns true, false otherwise."
+
+ self detect:aBlock ifNone:[^ false].
+ ^ true
+
+ "
+ #(1 2 3 4 5) contains:[:el | el odd]
+ #(2 4 6 8 10) contains:[:el | el odd]
+ "
+
+ "Modified: 26.5.1997 / 17:38:57 / cg"
+!
+
count:aBlock
"count elements, for which aBlock returns true.
Return the sum."
@@ -1622,6 +1637,6 @@
!Collection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.69 1997-05-10 12:15:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.70 1997-05-26 15:39:16 cg Exp $'
! !
Collection initialize!