IT lexicon › Programming › Cons-cell

Cons-cell

Programming På svenska → Updated: 2026-11-12

The fundamental data structure in Lisp—an ordered pair pointing to a value and a tail, forming the basis of linked lists.

The cons-cell is Lisp's DNA. A cons-cell is simply two pointers—one for the value (CAR) and one for the rest of the list (CDR). These pointers can themselves be cons-cells, building up linked lists. McCarthy designed this elegant minimalism in 1958 to represent everything from data to code. By making everything cons-cells, the Lisp interpreter could evaluate data as code (and vice versa). This structure enabled later garbage collection and became an inspiration for functional programming.

← Back to the lexicon