Common Lisp/Reference/car

From Wikibooks, open books for an open world
Jump to navigation Jump to search

car, along with cdr, is one of the basic building blocks of Common Lisp which are used to build cons cells.

The car operator, when applied to a list, returns the first element of that list. For example:

(car (list 1 2 3 4 5))

It can be replaced by first function [1]  :

 (first (list 1 2 3 4 5))

References[edit | edit source]

  1. Accessor FIRST at CLHS

See also[edit | edit source]