~mikelma/oktac

oktac/examples/factorial/factorial.ok -rw-r--r-- 154 bytes
79afb735 — mikelma basic lambda function support 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
fun factorial(n: i32): i32 {
    if n == 1 {
        ret n;
    } else {
        ret n*factorial(n-1);
    }
}

fun main(): i32 {
    ret factorial(5);
}