Common Lisp the Language 2nd Edition


next up previous contents index
Next: Arrays Up: Data Types Previous: Symbols

2.4. Lists and Conses

A cons is a record structure containing two components called the car and the cdr. Conses are used primarily to represent lists.

A list is recursively defined to be either the empty list or a cons whose cdr component is a list. A list is therefore a chain of conses linked by their cdr components and terminated by nil the empty list. The car components of the conses are called the elements of the list. For each element of the list there is a cons. The empty list has no elements at all.

A list is notated by writing the elements of the list in order A list is notated by writing the elements of the list in orderof the listtst" SRC="icons/next_motif.gif">