-
Notifications
You must be signed in to change notification settings - Fork 1
Tuples
Ígor Bonadio edited this page Jun 18, 2015
·
1 revision
- () is the empty tuple and its type is ()
- tuples of n > 0 elements are of type (Type1, Type2, ...), where Type1, Type2 can be any type (equal or different)
Grammar:
tuple : '(' tuple_elements? ')'
| tuple_elements
;
tuple_elements : (expression ',')* expression
;
Examples:
(1, 2, 3.3) # tuple of type (Int, Int, Real)
1, 2, 3.3 # parentheses are optional