((lambda (n)
((lambda (fact)
(fact fact n))
(lambda (ft k)
(if (= k 1)
1
(* k (ft ft (- k 1)))))))
10)
;|
Does this function really compute the factorial of 10?
How does it work step by step? What is the trick behind?
(Note:
It uses the so-called "Y operator", to give a pure lambda-calculus
implementation of recursion.
See "Structure and interpretation of computer programs",
Abelson/Sussmann/Sussmann, 2nd ed, Cambridge 1996, 393 or
"The Why of Y", Gabriel 1988, Lisp Pointer2(2):15-25
)
|;