Page:AIM-453.djvu/26



is that MAPGEN serves as a constructor of such procedures, thus capturing an interesting abstraction — we might call the result of (MAPGEN CAR * 1), for example, PRODUCT, and so on.

What is interesting about this is that we can write procedures which. This is not to be confused with the ability to construct S-expression of procedures; that ability is shared by all of the interpreters we have examined. The ability to construct procedures was not available in the dynamically scoped interpreter. In solving the violation of referential transparency we seem to have stumbled across a source of additional abstractive power. While the MAP example may seem strained, this example is quite natural: given a numerical function, to produce a new function which numerically approximates the derivative of the first.

Notice that this is a symbolic process dealing with the representation of F. The DERIVATIVE procedure knows nothing about the internal structure of F. All it does is construct a new procedure which uses F only by invoking it. The program DERIVATIVE captures (in approximation) the abstraction of "derivative" as a mapping from the space of numerical (and reasonably well-behaved!) functions to itself.

The ability to define procedures which construct other procedures is powerful. We can use it to construct procedures which behave like data objects. For example, since the only constraints which CONS must (so far) obey are the algebraic identities:

and

the value of (CONS α β) can be thought of as a procedure which produces α or β on demand (cf. [Hewitt and Smith] [Fischer]). We can write this as follows: