diff --git a/hello.ld b/hello.ld index 9c9c49a..fcf09cf 100644 --- a/hello.ld +++ b/hello.ld @@ -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 \ No newline at end of file +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) \ No newline at end of file