aboutsummaryrefslogtreecommitdiffstats
path: root/progs/tests/tuples.sy
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-03-08 18:38:39 +0100
committerGitHub <noreply@github.com>2021-03-08 18:38:39 +0100
commit44170a579266501143af63960fda8706df809c09 (patch)
tree79fa0b0c1869c550f0980c38b1cd549180aac8fb /progs/tests/tuples.sy
parentc61fb2a37fee54b7eb42da074e8c1b42aa6a42f1 (diff)
parent16ba42c52bbf57fa78217327bd9759fec9f09fa9 (diff)
downloadsylt-44170a579266501143af63960fda8706df809c09.tar.gz
Merge pull request #101 from FredTheDino/single-tuples
Single-element tuples
Diffstat (limited to 'progs/tests/tuples.sy')
-rw-r--r--progs/tests/tuples.sy24
1 files changed, 24 insertions, 0 deletions
diff --git a/progs/tests/tuples.sy b/progs/tests/tuples.sy
new file mode 100644
index 0000000..642e381
--- /dev/null
+++ b/progs/tests/tuples.sy
@@ -0,0 +1,24 @@
+start :: fn {
+ a := (1,2)
+ a[0] <=> 1
+ a[1] <=> 2
+
+ b := (1,)
+ b[0] <=> 1
+
+ empty := ()
+ c := (empty,)
+ c[0] <=> ()
+
+ d := (1,2)
+ d[0] <=> d[0]
+
+ {
+ q := d[2-2]
+ d[d[(5 + 3) * 0]] <=> d[d[(5 + 3) * 0]]
+ w := d[0]
+ q + w
+ q - w
+ q * w
+ }
+}