Next: , Previous: , Up: ArrayedCollection   [Index]


1.5.6 ArrayedCollection: enumerating the elements of a collection

collect: aBlock

Answer a new instance of an ArrayedCollection containing all the results of evaluating aBlock passing each of the receiver’s elements

reject: aBlock

Answer a new instance of an ArrayedCollection containing all the elements in the receiver which, when passed to aBlock, answer false

select: aBlock

Answer a new instance of an ArrayedCollection containing all the elements in the receiver which, when passed to aBlock, answer true

with: aSequenceableCollection collect: aBlock

Evaluate aBlock for each pair of elements took respectively from the receiver and from aSequenceableCollection; answer a collection of the same kind of the receiver, made with the block’s return values. Fail if the receiver has not the same size as aSequenceableCollection.