I’m reading the book called the little schemer.
Before read that, i’ve finished reading first three chapter of SICP.
My question is that why second argument to cons must be a list.
However, (cons a b) works for all values a and b and
(car (cons a b)) = a
(cdr (cons a b)) = b
The second argument to
consis not necessarily a list. It’s a list only if you’re, well, building a list (proper or otherwise). It’s perfectly valid if thecdrpart of aconscell is not a list, for example, when building an association list: