Quirksand

SICP

SICP 1.3.1 Exercises

January 2, 2013 22:43

This section introduces the idea of procedures that work with other procedures as arguments. Scheme makes it easy to do this, since the arguments to a procedure can be anything, as long as it is used correctly within the procedure.

The exercises work with several math functions which are called in this manner. Some of them include rewriting a procedure in an iterative or recursive form. The alternate forms show how rewriting one procedure affects (or does not affect) the higher or lower-order procedures that are used with it.

This allows us to do something similar in our testing. Rather than type out the same sequence of examples, they are wrapped up in a procedure that calls them. In order for this to work, the procedure names must be reused. If your environment does not allow for re-defining of procedures, the tests may need to be changed to work around this.

Exercises 1.3.1