git @ Cat's Eye Technologies Lanthorn / master eg / different-arities.lanthorn
master

Tree @master (Download .tar.gz)

different-arities.lanthorn @masterraw · history · blame

1
2
3
4
5
letrec
    oddsump  = fun(x,y,z) -> if eq(add(x, add(y, z)), add(y, z)) then false else evensump(sub(x, 1), add(y, z))
    evensump = fun(p,q)   -> if eq(add(p, q), q) then true else oddsump(sub(p, 1), 1, sub(q, 1))
in
    oddsump(5,3,1)