play around

This commit is contained in:
Scott Richmond 2022-04-25 20:37:52 -04:00
parent 3c51394278
commit c107289920

View File

@ -1,5 +1,20 @@
import "foo.ld" as Foo
fn fib {
(0) -> 1
(1) -> 1
(n) -> add (
fib (sub (n, 1)),
fib (sub (n, 2)))
}
do #{:foo "bar"
:bar (2, 3, :quux)
:baz [12, 34]} > show > print
fn fact {
(n) -> fact (n, 1)
(1, acc) -> acc
(n, acc) -> fact (sub (n, 1), mult (n, acc))
}
ns Recursive {
fact
fib
}
:factl (Recursive) (6)