mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
11 lines
190 B
Plaintext
11 lines
190 B
Plaintext
fun factorial (n: int): int = do
|
|
match n with
|
|
| 0 -> return 1;
|
|
| else return n * factorial(n - 1);
|
|
end;
|
|
end;
|
|
|
|
fun main: void = do
|
|
factorial(5) |> @write(_);
|
|
end;
|