Next: Basic abstractions for pairs
Up: Discovering the Power of
Previous: Application of numeric abstractions
Contents
Start
Collections of Data
In A++ collections of data can be handled by the use of the
list pattern. Readers are referred back to the discussion of
general programming patterns in section pattern:list.
In order to work with pairs and lists the following abstractions are needed as a minimum:
- cons the constructor of a pair
- car the selector of the head of a pair
- cdr the selector of the tail of a pair
- nullp a predicate to check, whether the list is empty
- pairp a predicate to check, whether the object is a pair
Subsections
Georg P. Loczewski
2004-03-05