play around
This commit is contained in:
parent
3c51394278
commit
c107289920
23
hello.ld
23
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
|
||||
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)
|
Loading…
Reference in New Issue
Block a user