Test recursion. It works!
This commit is contained in:
parent
272951a411
commit
b7d49cbf5d
|
@ -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)
|
||||
|
||||
")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user