summaryrefslogtreecommitdiff
path: root/tests/sumrec.bth
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sumrec.bth')
-rw-r--r--tests/sumrec.bth7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/sumrec.bth b/tests/sumrec.bth
new file mode 100644
index 0000000..8c8804a
--- /dev/null
+++ b/tests/sumrec.bth
@@ -0,0 +1,7 @@
+(set f' (fn (x acc)
+ (if (< x 1)
+ acc
+ (f' (- x 1) (+ acc x)))))
+(set f (fn (x) (f' x 0)))
+(say (f 10))
+(say (f 100))