Collection



Collection inherits from Object and defines no instance variables. It has subclasses Bag, KeyedCollection, and Set.

Collections are general purpose data structures. Growable collections are implemented using #become:.

Of interest are a few methods implemented here that are not part of some other Smalltalks:

#accumulate:into:
This is useful for concatenating several collections (usually Strings).

#allSatisfy: and #anySatisfy:
These work as generalized AND or OR statements. Some other Smalltalks call these #conform: and #contains: (respectively).

#do:separatedBy:
Like #do:, but evaluates the 'separatedBy' block between every evaluation of the 'do' block.

#select:do:
Like #select: followed by #do:, but avoids creating an intermediate collection.

Methods defined in Collection:

Methods for accessing:

Methods for adding/removing:

Methods for comparing:

Methods for converting:

Methods for copying:

Methods for enumerating:

Methods for predicates:

Methods for streaming:


Pocket Smalltalk Documentation