<- ^ ->
Tuples

9   Tuples

Tuple is datatype, that consists of two or more components, which are anonymous. Tuples are defined as:

        *[int, int] t1;                 // pair of integers
        *[int, string, bool] t2;
        *[ctx, ty] t3;
And used as:

        t1 = [1, 2];
        int a, b;
        [a, b] = t;
        // swap
        [a, b] = [b, a];
        t3 = [1, "hello", true];
        // true and false are keywords
        return [1, "one"];
They might come in handy, when you need to return more then one value from function.

More on tuples in Section 13 below.

<- ^ ->
Tuples