From 4c4df6613e2f96e384615ec1c1bcc0df53fa5bc8 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 31 Jan 2025 18:47:46 +0200 Subject: allow defines in curly braces --- examples/fib.lyn | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/fib.lyn (limited to 'examples') 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 -- cgit v1.2.3