| y-4.scm - Abstracting (f f) out of if. | Lecture 2 - slide 11 : 35 Program 4 |
; We wish to preserve the recusive form of factorial as much as possible.
; Therefore getting rid of (f f) in (lambda (n) ....)
; Abstracting if to get rid of (f f).
(let ((fac (lambda (f) ; THE NAME fac IS NOW MISLEADNIG
(lambda (n)
(let ((g (lambda (h)
(if (= n 0) 1 (* n (h (- n 1)))))))
(g (f f))) ))))
((fac fac) 5))