Dodo doc >
Syntax >
Literal Values >
Tuples
Tuples
Tuples, also known as product or record type values, contain a specific number of values in a specific order. A tuple is written with round brackets around.
Examples:
(1, two, 3, "go")
(red, green, blue)
("Hello")
Note: A tuple containing a single value cannot be distinguished from the value itself.
The empty tuple is of type Void and an instance of it is struct.
Rationale:
Round brackets are commonly used to delimit an expression, with this syntax they can delimit any number of expressions.
Having no distinction between a value and a unary tuple ensures that brackets can still be used as delimiters.
Since dodo is a prototypes language, it makes sense that struct is an empty tuple that can be extended by adding attributes.
^ 2.4.5. Collection Literals
v 2.4.7. Pattern Literals