1 | #### tuple literal doesn't conflict with (( |
2 | if ((0,0) < (0,1)) { echo yes } |
3 | ## STDOUT: |
4 | yes |
5 | ## END |
6 | |
7 | #### Empty tuple |
8 | var t = () |
9 | echo length=$len(t) |
10 | ## STDOUT: |
11 | length=0 |
12 | ## END |
13 | |
14 | #### Singleton tuple |
15 | var t = tup(42) |
16 | echo "length = $[len(t)]" |
17 | echo "t[0] = $[t[0]]" |
18 | |
19 | # NOT ALLOWED. Use tup() instead. |
20 | #var t1 = 1, |
21 | var t2 = (1,) |
22 | ## status: 2 |
23 | ## STDOUT: |
24 | length = 1 |
25 | t[0] = 42 |
26 | ## END |