v2026.5.3
All Bundles
Bundle Typed tuple classes (Pair, Triple, Quad) for grouping related values without defining a class. Immutable by design; use as map keys or return values. Compile with -lib gen_collect.

Pair

Tuple class that supports 2 values

pair := Collection.Tuple.Pair->New("name", 42)<String, IntRef>;
pair->GetFirst()->PrintLine();
pair->GetSecond()->PrintLine();

Operations

GetFirst #

Returns the first value

method : public : GetFirst() ~ A

Return

TypeDescription
Afirst value

Example

pair := Collection.Tuple.Pair->New("alpha", 1)<String, IntRef>;
pair->GetFirst()->PrintLine(); # alpha

GetSecond #

Returns the second value

method : public : GetSecond() ~ B

Return

TypeDescription
Bsecond value

Example

pair := Collection.Tuple.Pair->New("beta", 2)<String, IntRef>;
pair->GetSecond()->PrintLine(); # 2

New # constructor

Constructor.

New(a:A, b:B)

Parameters

NameTypeDescription
aAfirst parameter
bBsecond parameter

Example

pair := Collection.Tuple.Pair->New("hello", 42)<String, IntRef>;
pair->GetFirst()->PrintLine();  # hello
pair->GetSecond()->PrintLine(); # 42

ToString #

Formats tuple into a string

method : public : ToString() ~ String

Return

TypeDescription
Stringstring representation

Example

pair := Collection.Tuple.Pair->New("x", 99)<String, IntRef>;
pair->ToString()->PrintLine(); # [x,99]