Common Lisp/Reference/car

From Wikibooks, open books for an open world
Jump to: navigation, 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))
1

It can be replaced by first function [1]  :

 (first (list 1 2 3 4 5))
1

References[edit]

  1. Accessor FIRST at CLHS

See also[edit]