Classes | Collections > Unordered

Set : Collection : Object

a set according to equality
Subclasses: Dictionary, IdentitySet


A Set is s collection of objects, no two of which are equal. Most of its methods are inherited from Collection. The contents of a Set are unordered. You must not depend on the order of items in a set. For an ordered set, see OrderedIdentitySet.

Class Methods

Inherited class methods

Undocumented class methods 2)

Instance Methods

Adding and Removing


Add anObject to the Set. An object which is equal to an object already in the Set will not be added.


Remove anObject from the Set.



Evaluates function for each item in the Set. The function is passed two arguments, the item and an integer index.


Returns the object at the internal index. This index is not deterministic.

Set specific operations



Return the set theoretical intersection of this and that.



Return the set theoretical union of this and that.



Return the set of all items which are elements of this, but not of that.



Return the set of all items which are not elements of both this and that.


Returns true if all elements of this are also elements of that.

Inherited instance methods

Undocumented instance methods


.array = value