git @ Cat's Eye Technologies Lanthorn / 73f392c
Fix syntax error in test case (but the problem is much deeper). Chris Pressey 3 years ago
2 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
322322
323323 letrec
324324 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))
325 evensump = fun(p,q) -> if eq(add(x, q), q) then true else oddsump(sub(x, 1), 1, sub(q, 1))
325 evensump = fun(p,q) -> if eq(add(p, q), q) then true else oddsump(sub(p, 1), 1, sub(q, 1))
326326 in
327327 oddsump(5,3,1)
328328 ===> true
0 letrec
1 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))
2 evensump = fun(p,q) -> if eq(add(p, q), q) then true else oddsump(sub(p, 1), 1, sub(q, 1))
3 in
4 oddsump(5,3,1)