summaryrefslogtreecommitdiff
path: root/test.pez
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-10-10 16:18:02 +0200
committerlemon <lsof@mailbox.org>2022-10-10 16:18:02 +0200
commit77dd89282880373645769101c6f795a9a5ce6ff3 (patch)
treea1ddd7638643fdbee9ea07f60d804ca886907b6a /test.pez
parent113ca8ba774006c1d24bc399dd42756cc3239bf6 (diff)
varargs
Diffstat (limited to 'test.pez')
-rw-r--r--test.pez9
1 files changed, 9 insertions, 0 deletions
diff --git a/test.pez b/test.pez
index eb98d75..b6dcd8c 100644
--- a/test.pez
+++ b/test.pez
@@ -26,3 +26,12 @@ FOR [@x: 0][< 10][+ 1]
m[x, y] = x ^ y
printf["%a == %a\n", m[3,7], 3^7]
+
+@add: {[*]
+ @acc = 0
+ FOR [@i: 0][< SEL$][+ 1]
+ acc += SEL[i]
+ acc
+}
+
+printf["4+1+3: %a\n", add[4,1,3]]