next up previous contents
Next: Unions Up: Concrete differences Previous: Module system   Contents

Tuples

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

        *[int, int] t1;
        *[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

More on tuples in `Patterns' below.

[[Yes, you guessed, there are no tuples yet]]



Micha³ Moskal 2001-12-03