(print "------------------------------------------------") (print "Testing the Y combinator") (with [Y = (fun (g) : ((fun (f) : (g (fun (a) : ((f f) a)))) (fun (f) : (g (fun (a) : ((f f) a))))))] : (with [fact = (Y (fun (r) : (fun (n) : (if (n == 0) then 1 else (n * (r (n - 1)))))))] : (print "(fact 5) is" (fact 5)))) (print "Testing recursive factorial") (def factorial (fun (n) : (if (n == 0) then 1 else (n * (factorial (n - 1)))))) (print "(factorial 5) is" (factorial 5))