Tuple enumeration

Tuple enumeration is a notation for creating instances of Tuple.


An example tuple enumeration using listed arguments:

[Integer, Float, String] one23 = [1, 2.0, "three"];



Syntactically a tuple enumeration is a positional argument list enclosed within square brackets [ and ].

If you supply no arguments you obtain the empty tuple, [], which is precisely the same as empty.

All kinds of positional argument are available. For example, consider the tuple constructed using a spread argument:

[Integer, Integer, Float, String] zero123 = [0, *one23];

Or a tuple enumeration with a comprehension argument:

value oneTo10 
    = [1, 2, for (i in 3..10) i ];


The type of a tuple enumeration is the Tuple type of the list of arguments it contains.

See also