--- a/RunArray.st Fri Sep 06 01:07:12 2013 +0200
+++ b/RunArray.st Fri Sep 06 01:12:44 2013 +0200
@@ -576,6 +576,22 @@
"
"Modified: / 30.10.1997 / 14:38:45 / cg"
+!
+
+atAllPut:anObject
+ "replace all elements of the collection by the argument, anObject.
+ Notice: This operation modifies the receiver, NOT a copy;
+ therefore the change may affect all others referencing the receiver."
+
+ contentsArray := Array with:(self size) with:anObject
+
+ "
+ |c|
+
+ c := RunArray new:20.
+ c atAllPut:1.
+ Transcript showCR:c.
+ "
! !
!RunArray methodsFor:'adding & removing'!
@@ -847,6 +863,20 @@
!RunArray methodsFor:'enumerating'!
+conform:aBlock
+ "return true, if every element conforms to some condition.
+ I.e. return false, if aBlock returns false for any element;
+ true otherwise. Returns true for empty receivers."
+
+ "/ redefined to not check individual elements, but runs
+ contentsArray notNil ifTrue:[
+ contentsArray pairWiseDo:[:len :val |
+ (aBlock value:val) ifFalse:[^ false].
+ ]
+ ].
+ ^ true
+!
+
do:aBlock
"Evaluate aBlock with each of the receiver's elements as the
argument. "
@@ -1356,10 +1386,10 @@
!RunArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.34 2013-06-24 17:53:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.35 2013-09-05 23:12:44 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.34 2013-06-24 17:53:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.35 2013-09-05 23:12:44 cg Exp $'
! !