Product Site

5.3.20.1. Principles of Operation

A set operation is performed by iterating over the elements of the receiver collection to compare each element of the receiver with each element of the argument collection. The element is defined as the tuple (index, item) (see Section 5.3.20.4, “Determining the Identity of an Item”). Depending on the set-operator method and the result of the comparison, an element of the receiver collection is, or is not, included in the resulting collection. A receiver collection that allows for duplicate elements can, depending on the set-operator method, also accept elements of the argument collection after they have been coerced to the type of the receiver collection.

The following examples are to help you understand the semantics of set operations. The collections are represented as a list of elements enclosed in curly brackets. The list elements are separated by a comma.