From 77dd89282880373645769101c6f795a9a5ce6ff3 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 10 Oct 2022 16:18:02 +0200 Subject: varargs --- test.pez | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test.pez') 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]] -- cgit v1.2.3