summaryrefslogtreecommitdiff
path: root/test.pez
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-10-08 11:08:42 +0200
committerlemon <lsof@mailbox.org>2022-10-08 11:08:42 +0200
commite2283f6c7f5abc60dc7ba7ea59deee94da714da7 (patch)
treeb007ad4820b016ec90c614b218c5e529560e1d8f /test.pez
initial commit
Diffstat (limited to 'test.pez')
-rw-r--r--test.pez16
1 files changed, 16 insertions, 0 deletions
diff --git a/test.pez b/test.pez
new file mode 100644
index 0000000..93d06b7
--- /dev/null
+++ b/test.pez
@@ -0,0 +1,16 @@
+~fib = {[x]
+ x < 2 ? x : fib[x - 1] + fib[x - 2]
+}
+
+printf["fib[10] = %a\n", fib[10]]
+
+@sum: {[xs] @a = 0
+ @n: xs.length
+ FOR [@i: 0][< n][+ 3] (
+ a += xs[i]
+ )
+ a
+}
+
+(@l: #[1,5,-2,7]
+ printf["sum[%a] = %a\n", l, sum[l]])