Class std::Pair<L, R>

Instances of the Pair class represent immutable pairs of two arbitrary values. Pairs can only be constructed using the colon (:) operator. A typical use of pair objects is as arguments to the constructor of the std::Map class, where pairs represent (key, value) pairs, and in range indexing.

class Pair
The Pair type. Pair objects can be constructed using the colon (:) operator. Within an index expression (inside square brackets [ ]), the left or right operand, or both, can be left out; in this case the values default to nil.

Member constants

left as L
The first (left) item in the pair.
right as R
The second (right) item in the pair.


x : y (L : RPair<L, R>)
Construct a pair with values x (left) and y (right).
pair == x (Pair<L, R> == ObjectBoolean)
Pair objects can be compared for equality. Two pairs are equal if and only if both their left and right items are equal.
Convert a pair to a string.
Return the hash value of a pair.