ch1_4_conscells
This is an old revision of the document!
List construction with conscells
There is no list
We have learned that Lisp expressions consist of atoms and lists, but in fact, there is no list object in the background. A list in Lisp is constructed with objects called conscells, or simply cons
.
Conscell is an object holding two pointers, the first points to an element of the list and the second points to the next conscell. That means Lisp lists are unidirectional linked lists.
For historical reasons, the pointers are called car
and cdr
.
ch1_4_conscells.1714837896.txt.gz · Last modified: 2024/05/04 09:51 by admin