aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test.lisp')
-rw-r--r--examples/test.lisp16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/test.lisp b/examples/test.lisp
index 276dcd5..536caa5 100644
--- a/examples/test.lisp
+++ b/examples/test.lisp
@@ -27,13 +27,23 @@
(filter pred [0 1 2 3 4 5])
+;; (let fibo (\[n]
+;; (match n
+;; 0 0
+;; 1 1
+;; (+
+;; (fibo (- n 1))
+;; (fibo (- n 2))))))
+
+;; (fibo 10)
+
(let fibo (\[n]
+ (let lazy fibo-1 (fibo (- n 1)))
+ (let lazy fibo-2 (fibo (- n 2)))
(match n
0 0
1 1
- (+
- (fibo (- n 1))
- (fibo (- n 2))))))
+ (+ fibo-1 fibo-2))))
(fibo 10)