Pair Reference
A Pair allows two values to be stored and accessed together.
var pair = Pair(1, 2);var left = pair.left; // 1var right = pair.right; // 2Fields
Section titled “Fields”Can be used to access to first element of the pair to set/get it.
var pair = Pair(nil, 2);pair.left = 1;var left = pair.left; // 1dyn!
Can be used to access to second element of the pair to set/get it.
var pair = Pair(1, nil);pair.right = 2;var right = pair.right; // 2dyn!
Methods
Section titled “Methods”to_array
Section titled “to_array”Returns an array of the Pair values.
var pair = Pair(1, 2);var arr = pair.to_array(); // [1, 2]Parameters
Section titled “Parameters”None
Returns
Section titled “Returns”[dyn!] - An containing the left and right values of the Pair, in that order.