@head @module set @title set: Set type
The Set class implements a set of objects. Any objects that can
be used as @ref{Map} keys can be added to a set. The Set class
enforces the set constraint: any object may be included in a set at most
a single time. An object can be added to a set even when the set already
contains that object, but the operation will have no effect. The order of item
additions and removals is not significant — a set object only records
which objects are currently included in the set, but the objects have no
specific order.
@h2 Class Set<T>
@implements Iterable Set objects support the following operations:
@op x in set @optype{Object in SetSet methods
@fun length() as Int
@desc Return the number of objects in the set.
@end
@fun add(object as T)
@desc Add an object to the set. If the object is already in the set, this
operation does nothing.
@end
@fun remove(object as T)
@desc Remove an object from the set. Do nothing if the object is not included
in the set.
@end
@fun iterator() as IteratorSet operations