Throughout the previous chapters, we have used functions to implement abstraction. We have broken problems down into smaller, more manageable pieces and have implemented functions that we can call over and over again. In the previous section we pushed this idea one step further by passing functions as parameters to other functions. In this section we explore in more detail the underlying mechanics of functions and parameter passing.
Consider the function shown in LISTING 6.7, which computes the hypotenuse of a right triangle. Using the Pythagorean theorem, a2 + b2 = c2, this function needs the lengths of the two sides, called
b, and computes and returns the length of the long side, called ...