next up previous contents index
Next: SortedAssociationSet Up: Set Previous: minus!   Contents   Index


union


Usage

union(x,t)
union(x,y)
union!(x,t)
union!(x,y)


Signature

union: (%, %) $\to$ %


Parameter Type Description
x,y % sets
t T an element


Returns

union(x,y) and union!(x,y) both return $x \cup y = \{ a \mbox{ such that }a \in x \mbox{ or } a \in y\}$, while union(x,t) and union!(x,t) both return $x \cup \{t\}$.


Remarks

union! does not make a copy of $x$, which is therefore modified after the call. It is unsafe to use the variable $x$ after the call, unless it has been assigned to the result of the call, as in x := union!(x, y).



Manuel Bronstein 2004-06-28