The functions of section
stretch our understanding
of evaluation. It is easy to understand how functions consume numbers and
symbols; cosuming structures and lists is a bit more complicated, but still
within our grasp; but functions consuming functions is a strange idea. As a
matter of fact, the functions of section
violate the
Scheme grammar of section
.
In this section, we discuss how to adjust Scheme's grammar and evaluation rules so that we can understand the role of functions as data or values. Without a good understanding of these ideas, we cannot hope to abstract functions. Once we understand these ideas, we can turn to the problem of writing contracts for such functions. Finally, the last part of the section introduces functions that produce functions, another powerful abstraction technique.