An IdentitySet is a collection of objects, no two of which are the same object (aka. "identical"). Most of its methods are inherited (see Collection and Set classes). The contents of an IdentitySet are unordered. You must not depend on the order of items in an IdentitySet. For an ordered set, see OrderedIdentitySet.
IdentitySets are faster than Sets because testing for identity is much faster than testing for equality. Different classes may implement equality in different ways, but identity can be determined just by comparing the object addresses. This allows some methods of IdentitySet to be implemented by fast primitives.
Add anObject to the IdentitySet. An object which is equal to an object already in the IdentitySet will not be added.
Remove anObject from the IdentitySet.
Evaluates function for each item in the IdentitySet. You must not depend on the order of items. The function is passed two arguments, the item and an integer index.
Returns item if it is in the collection, otherwise returns nil.