Note: information on this page refers to Ceylon 1.0, not to the current release.
Tuple enumeration
Tuple enumeration is a notation for creating instances of
Tuple
.
Usage
[Integer, Float, String] tuple = [1, 2.0, "three"];
Description
Syntax
Syntactically a tuple enumeration is an
argument list enclosed
within square brackets [
and ]
.
The empty tuple, []
, has the value
empty
.
Type
The type of a tuple enumeration is the
Tuple
type of the list of arguments it contains.
As well as the example above, consider the tuple constructed using a spread argument:
{Integer*} ints = {};
[Integer+] variadic = [1, *ints];
See also
- Iterable and tuple enumeration in the Ceylon language specification