diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2022-09-24 21:43:08 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | 8831c89b582ee96fa4bf2078ad5a66302a6eeb66 (patch) | |
| tree | 6bcc598eff42e05441a9cf2ceed188587e77376f /examples | |
| parent | a2e9732fb8f432e89d820601b1035c36c69e9340 (diff) | |
Implement let exprs in function def
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/test.lisp | 16 |
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) |
