diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-31 18:47:46 +0200 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-31 18:47:46 +0200 |
commit | 4c4df6613e2f96e384615ec1c1bcc0df53fa5bc8 (patch) | |
tree | 0cc5c2ef81bc70d861581ed750935bd9766eb7be /examples | |
parent | aac24c2c43a8047ceb41f1b34336ba2ed8064569 (diff) | |
download | lyn-master.tar.gz lyn-master.zip |
Diffstat (limited to 'examples')
-rw-r--r-- | examples/fib.lyn | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/fib.lyn b/examples/fib.lyn new file mode 100644 index 0000000..b24f18b --- /dev/null +++ b/examples/fib.lyn @@ -0,0 +1,12 @@ +define (fib n) { + if (< n 2) { + get 1 + } { + define f1 (fib (- n 1)) + define f2 (fib (- n 2)) + + f1 f2 + } +} + +display (fib 42) +newline |