diff -r 15742e6c1632 -r 52198bb46e04 Collection.st --- a/Collection.st Thu Jul 14 10:53:17 2016 +0100 +++ b/Collection.st Fri Jul 15 07:00:33 2016 +0200 @@ -41,9 +41,9 @@ " Abstract superclass for all collections. This abstract class provides functionality common to all collections, - without knowing how the concrete class implements things. + without knowing how the concrete class implements things. Thus, all methods found here depend on some basic mechanisms - to be defined in the concrete class. + to be defined in the concrete class. These basic methods are usually defined as #subclassResponsibility here. Some methods are also redefined for better performance. @@ -1145,7 +1145,7 @@ Notice: for some collections (those not tuned for resizing themself) this may be very slow. - If the number of removed elements is big compared to to + If the number of removed elements is big compared to the receiver's size, it may be better to copy the ones which are not to be removed into a new collection." @@ -1214,7 +1214,7 @@ Notice: for some collections (those not tuned for resizing themself) this may be very slow. - If the number of removed elements is big compared to to + If the number of removed elements is big compared to the receiver's size, it may be better to copy the ones which are not to be removed into a new collection." @@ -3578,14 +3578,14 @@ ^ newCollection " - #(1 2 3 4) select:[:e | e odd] as:OrderedCollection. - (1 to:10) select:[:e | e even] as:OrderedCollection. - - #(1 2 3 4) select:[:e | e odd] as:Set. - (1 to:10) select:[:e | e even] as:Set. - - #(1 2 3 4) select:[:e | e odd] as:ByteArray. - (1 to:10) select:[:e | e even] as:ByteArray. + #(1 2 3 4) select:[:e | e odd] as:OrderedCollection. + (1 to:10) select:[:e | e even] as:OrderedCollection. + + #(1 2 3 4) select:[:e | e odd] as:Set. + (1 to:10) select:[:e | e even] as:Set. + + #(1 2 3 4) select:[:e | e odd] as:ByteArray. + (1 to:10) select:[:e | e even] as:ByteArray. " "Created: / 07-08-2010 / 16:26:15 / cg" @@ -3716,14 +3716,14 @@ anNArgBlock valueWithArguments:aTuple ] " - #( - (1 one eins uno) - (2 two zwei due) - (3 three drei tre) - (4 four vier quattro) - (5 five #'fuenf' cinque) - ) - tuplesDo:[:num :sym1 :sym2 :sym3 | + #( + (1 one eins uno) + (2 two zwei due) + (3 three drei tre) + (4 four vier quattro) + (5 five #'fuenf' cinque) + ) + tuplesDo:[:num :sym1 :sym2 :sym3 | Transcript show:num; space; show:sym1; space; show:sym2; space; showCR:sym3 ] " @@ -4073,16 +4073,16 @@ ! noneSatisfy:aBlock - "evaluate aBlock for each of the receiver's elements. + "evaluate aBlock for each of the receiver's elements. Return true, if aBlock returns false for all elements, false otherwise (i.e. false if any element satisfies the block-condition)." ^ (self contains:aBlock) not " - #(1 2 3 4 5) noneSatisfy:[:el | el odd] - #(2 4 6 8 10) noneSatisfy:[:el | el odd] - #(2 4 6 8 10) noneSatisfy:[:el | el even] + #(1 2 3 4 5) noneSatisfy:[:el | el odd] + #(2 4 6 8 10) noneSatisfy:[:el | el odd] + #(2 4 6 8 10) noneSatisfy:[:el | el even] " "Modified: / 13-09-2006 / 11:19:57 / cg" @@ -4090,7 +4090,7 @@ !Collection methodsFor:'error handling'! -emptyCheck +emptyCheck "check if the receiver is empty; report an error if so" self isEmpty ifTrue:[ @@ -4166,7 +4166,7 @@ ! notEnoughElementsError - "report an error that the operation is not allowed, + "report an error that the operation is not allowed, since not enough elements are in the collection" @@ -4247,7 +4247,7 @@ " #(1 2 3 'hello' $a) asOrderedCollection displayString - (Dictionary new at:#hello put:'world'; + (Dictionary new at:#hello put:'world'; at:#foo put:'bar'; yourself) displayString " @@ -4333,14 +4333,14 @@ " #(1 2 3 'hello' $a $ü) printOn:Transcript (Array new:100000) printOn:Transcript - (Array new:100000) printOn:Stdout - (Array new:100000) printString size - (Dictionary new at:#hello put:'world'; + (Array new:100000) printOn:Stdout + (Array new:100000) printString size + (Dictionary new at:#hello put:'world'; at:#foo put:'bar'; yourself) printOn:Transcript " " |a| - a := Array new:3. + a := Array new:3. a at:2 put:a. a printOn:Transcript "