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.
Quartet
Tuple class that supports 4 values
quartet := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
quartet->GetFirst()->PrintLine();
quartet->GetSecond()->PrintLine();
quartet->GetThird()->PrintLine();
quartet->GetFourth()->PrintLine();Operations
GetFirst #
Returns the first value
method : public : GetFirst() ~ AReturn
| Type | Description |
|---|---|
| A | first value |
Example
q := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
q->GetFirst()->PrintLine(); # BobGetFourth #
Returns the fourth value
method : public : GetFourth() ~ DReturn
| Type | Description |
|---|---|
| D | fourth value |
Example
q := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
q->GetFourth()->PrintLine(); # trueGetSecond #
Returns the second value
method : public : GetSecond() ~ BReturn
| Type | Description |
|---|---|
| B | second value |
Example
q := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
q->GetSecond()->PrintLine(); # 25GetThird #
Returns the third value
method : public : GetThird() ~ CReturn
| Type | Description |
|---|---|
| C | third value |
Example
q := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
q->GetThird()->PrintLine(); # 3.14New # constructor
Constructor.
New(a:A, b:B, c:C, d:D)Parameters
| Name | Type | Description |
|---|---|---|
| a | A | first parameter |
| b | B | second parameter |
| c | C | third parameter |
| d | D | fourth parameter |
Example
q := Collection.Tuple.Quartet->New("Bob", 25, 3.14, true)<String, IntRef, FloatRef, BoolRef>;
q->GetFirst()->PrintLine(); # Bob
q->GetFourth()->PrintLine(); # true