After an introduction to functional programming, Section 2 discusses the functional features of Mathematica. Next, we treat higher-order functions and their applications, such as mapping and folding, and we show how procedural control structures can be replaced by functional code. The last section is about a more theoretical aspect of functions: fixed-point operators and the theory of complete partial orders. These concepts can be realized in Mathematica and we can give simple examples of their usefulness.
The initial effort required to get acquainted with the notion of functions as values is well worth it. Thinking functionally, we can solve a range of problems far more elegantly than with the usual loop, which we often use first, without thinking, due to the lopsided introduction to programming to which most of us were subjected. Mathematica offers both worlds and is an ideal vehicle for experiments in programming style. This chapter shows some of the not-so-obvious uses of higher-order functions. It shows that programs themselves are values that can be manipulated by other programs.
Y.m