Exercise 1.4.7


A list is either the empty list, or a chain of Cons-Cells ending with the empty list.

* (listp nil)

* (listp (cons 5 nil))

If you cons something onto the empty list, you get the list of that thing.

* (cons 5 nil)

We can exploit the Cons-Cells' ability to contain heterogenous data in order to represent linked lists or trees.

* (cons 3 (cons 2 (cons 1 nil)))
(3 2 1)

results matching ""

    No results matching ""