Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recursion without define and letrec [Section] -- Keyboard shortcut: 'p'  Next page: Development of the Y-combinator -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Recursion and Higher-order Functions - slide 10 : 35

The Challenge

It is not straightforward to program a recursive function in Scheme - using just lambda

A naive attempt to define a recursive function.
Equivalent to the program above.
A definition of fac with letrec.
Equivalent to the program above - notice the use of assignment.
Passing fac to itself - the key to a solution.

We now wish to separate the factorial stuff and the self passing stuff

This involves a number of steps - each of which are simple - but the resulting self passing stuff ends up being complicated