[previous] [up] [next]     [index]
Next: Mixing and Distinguishing Data Up: Processing Simple Forms of Previous: Extended Exercise: Hangman

The Varieties of Data

The previous section significantly expands our world of data. We must now deal with a universe that contains booleans, symbols, and structures of many kinds. Let's bring some order to this world.

Up to this point, our functions have always processed subclasses of four different kinds of data:[footnote]

numbers:
representations of numeric information;
booleans:
truth and falsity;
symbols:
representations of symbolic information; and
structures:
representations of compounds of information.

On occasion, however, a function must process a class of data that includes both numbers and structures or structures of several different kinds. We learn to design such functions in this section. In addition, we learn how to protect functions from bad uses. Here a bad use means that some user can accidentally apply a function for drawing circles to a rectangle. Although we have agreed that such users violate our data definitions, we should nevertheless know how to protect our functions against such uses, when necessary.





PLT