ref: f75a890bab649f57ee1f2cfffec8c74cc8b0ed49
parent: 05764878243785d7bae1dda067d86eb9bcaec443
author: Ori Bernstein <ori@eigenstate.org>
date: Sat May 26 10:54:02 EDT 2018
Add test for recursive closure.
--- /dev/null
+++ b/test/closurerec.myr
@@ -1,0 +1,15 @@
+use std
+
+const main = {
+ const fib = {n
+ if n <= 0
+ -> 0
+ elif n == 1
+ -> 1
+ else
+ -> fib(n - 1) + fib(n - 2)
+ ;;
+ }
+ std.exit(fib(8))
+}
+
--- a/test/tests
+++ b/test/tests
@@ -64,6 +64,7 @@
B nestfn E 42
B foldidx P 123,456
B closure P 111555333666
+B closurerec E 21
B fncast P ok
B loop P 0123401236789
B subrangefor P 12