Common Lisp the Language 2nd Edition


next up previous contents index
Next: Conses Up: Common Lisp the Language Previous: Sorting and Merging

15. Lists

A cons or dotted pair is a compound data object having two components called the car and cdr. Each component may be any Lisp object. A list is a chain of conses linked by cdr fields; the chain is terminated by some atom (a non-cons object). An ordinary list is terminated by nil the empty list (also written ()). A list whose cdr chain is terminated by some non-nil atom is called a dotted list.

The recommended predicate for testing for the end of a list is endp.



AI.Repository@cs.cmu.edu