| Recursion and Higher-order Functions - slide 11 : 35 |
We do a step-wise development that leads to the Y-combinator - following the trail devised by Richard Gabriel in The Why of Y.
Wishful thinking - the goal of our work: Generating a recursive factorial function from an almost recursive factorial function. |
The starting point - again. |
After simple currying. |
Abstracting (f f) out of if. |
After a simple renaming of fac to i. |
Introducing n as parameter to (lambda (h) ...). |
After currying. |
The lambda expression bound to g has been moved out. |
Empty let removed. |
Introduce function for (let ((i ..)) ...). |
A small but irritating detail. |
Factoring self application stuff out. |
The end result. |


![Next page: Introduction to higher-order functions [Section] -- Keyboard shortcut: 'n' Next page: Introduction to higher-order functions [Section] -- Keyboard shortcut: 'n'](./images/nav-right.gif)




