[previous] [up] [next]     [index]
Next: Processing Two Lists Simultaneously: Up: More on Processing Arbitrarily Previous: Refining Functions and Programs

Processing Two Complex Pieces of Data


external

On occasion, a function consumes two arguments that belong to classes with non-trivial data definitions. In some cases, one of the arguments should be treated as if it were atomic; a precisely formulated purpose statement typically clarifies this. In other cases, the two arguments must be processed in lockstep. Finally, in a few rare cases, the function must take into account all possible cases and process the arguments accordingly. This section illustrates the three cases with examples and provides an augmented design recipe for the last one. The last section discusses the equality of compound data and its relationship to testing; it is essential for automating test suites for functions.





PLT