[previous] [up] [next]     [index]
Next: Defining Natural Numbers Up: Processing Arbitrarily Large Data Previous: Extended Exercise: Moving Pictures

Natural Numbers


external

The only self-referential data definitions we have seen thus far involved cons and lists of arbitrary length. We needed such data definitions because the classes of lists that we wanted to process were of arbitrary size. Natural numbers are another class of data whose elements are of arbitrary size; after all, there is no limit on how large a natural number can be, and, at least in principle, a function should be able to process them all.

In this section, we study how to describe natural numbers with self-referential data definitions and how to develop functions that process natural numbers in a systematic fashion. Since such functions come in many flavors, we study several different flavors of definitions.





PLT