From b7d49cbf5da206718215e391290ed63cfca0f006 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sun, 20 Mar 2022 19:35:41 -0400 Subject: [PATCH] Test recursion. It works! --- src/ludus/interpreter.clj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ludus/interpreter.clj b/src/ludus/interpreter.clj index 59d82a3..d6b1900 100644 --- a/src/ludus/interpreter.clj +++ b/src/ludus/interpreter.clj @@ -246,6 +246,20 @@ (def source " + fn fib { + (0) -> 1 + (1) -> 1 + (n) -> add ( + fib (sub (n, 1)) + fib (sub (n, 2))) + } + + fn fact { + (1) -> 1 + (n) -> mult (n, fact (sub (n, 1))) + } + + fact (6) ")