<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
CAR	O
(	O
car	O
)	O
and	O
CDR	O
(	O
cdr	O
)	O
(	O
or	O
)	O
are	O
primitive	O
operations	O
on	O
cons	B-Protocol
cells	O
(	O
or	O
"	O
non-atomic	O
S-expressions	B-Protocol
"	O
)	O
introduced	O
in	O
the	O
Lisp	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
A	O
cons	B-Protocol
cell	O
is	O
composed	O
of	O
two	O
pointers	O
;	O
the	O
car	O
operation	O
extracts	O
the	O
first	O
pointer	O
,	O
and	O
the	O
cdr	O
operation	O
extracts	O
the	O
second	O
.	O
</s>
<s>
Thus	O
,	O
the	O
expression	O
(	O
car	O
(	O
cons	B-Protocol
x	O
y	O
)	O
)	O
evaluates	O
to	O
x	O
,	O
and	O
(	O
cdr	O
(	O
cons	B-Protocol
x	O
y	O
)	O
)	O
evaluates	O
to	O
y	O
.	O
</s>
<s>
When	O
cons	B-Protocol
cells	O
are	O
used	O
to	O
implement	O
singly	O
linked	B-Data_Structure
lists	I-Data_Structure
(	O
rather	O
than	O
trees	B-Application
and	O
other	O
more	O
complicated	O
structures	B-General_Concept
)	O
,	O
the	O
car	O
operation	O
returns	O
the	O
first	O
element	O
of	O
the	O
list	O
,	O
while	O
cdr	O
returns	O
the	O
rest	O
of	O
the	O
list	O
.	O
</s>
<s>
Lisp	B-Language
was	O
originally	O
implemented	O
on	O
the	O
IBM	B-Device
704	I-Device
computer	O
,	O
in	O
the	O
late	O
1950s	O
.	O
</s>
<s>
The	O
popular	O
explanation	O
that	O
CAR	B-Language
and	I-Language
CDR	I-Language
stand	O
for	O
"	O
Contents	O
of	O
the	O
Address	O
Register	O
"	O
and	O
"	O
Contents	O
of	O
the	O
Decrement	O
Register	O
"	O
does	O
not	O
quite	O
match	O
the	O
IBM	B-Device
704	I-Device
architecture	O
;	O
the	O
IBM	B-Device
704	I-Device
does	O
not	O
have	O
a	O
programmer-accessible	O
address	O
register	O
and	O
the	O
three	O
address	O
modification	O
registers	O
are	O
called	O
"	O
index	B-General_Concept
registers	I-General_Concept
"	O
by	O
IBM	O
.	O
</s>
<s>
The	O
704	O
and	O
its	O
successors	O
have	O
a	O
36-bit	O
word	O
length	O
and	O
a	O
15-bit	O
address	B-General_Concept
space	I-General_Concept
.	O
</s>
<s>
These	O
computers	O
had	O
two	O
instruction	O
formats	O
,	O
one	O
of	O
which	O
,	O
the	O
Type	O
A	O
,	O
had	O
a	O
short	O
,	O
3-bit	O
,	O
operation	B-Language
code	I-Language
prefix	O
and	O
two	O
15-bit	O
fields	O
separated	O
by	O
a	O
3-bit	O
tag	O
.	O
</s>
<s>
The	O
first	O
15-bit	O
field	B-Application
was	O
the	O
operand	O
address	O
and	O
the	O
second	O
held	O
a	O
decrement	O
or	O
count	O
.	O
</s>
<s>
The	O
tag	O
specified	O
one	O
of	O
three	O
index	B-General_Concept
registers	I-General_Concept
.	O
</s>
<s>
Indexing	O
was	O
a	O
subtractive	O
process	O
on	O
the	O
704	O
,	O
hence	O
the	O
value	O
to	O
be	O
loaded	O
into	O
an	O
index	B-General_Concept
register	I-General_Concept
was	O
called	O
a	O
"	O
decrement	O
"	O
.	O
</s>
<s>
Precursors	O
to	O
Lisp	B-Language
included	O
functions	O
:	O
</s>
<s>
The	O
704	O
assembler	B-Language
macro	O
for	O
car	O
was	O
:	O
</s>
<s>
The	O
704	O
assembler	B-Language
macro	O
for	O
cdr	O
was	O
:	O
</s>
<s>
A	O
machine	O
word	O
could	O
be	O
reassembled	O
by	O
cons	B-Protocol
,	O
which	O
took	O
four	O
arguments	O
(	O
a	O
,	O
d	O
,	O
p	O
,	O
t	O
)	O
.	O
</s>
<s>
The	O
prefix	O
and	O
tag	O
parts	O
were	O
dropped	O
in	O
the	O
early	O
stages	O
of	O
Lisp	B-Language
's	O
design	O
,	O
leaving	O
CAR	O
,	O
CDR	O
,	O
and	O
a	O
two-argument	O
CONS	B-Protocol
.	O
</s>
<s>
Compositions	B-Application
of	O
car	B-Language
and	I-Language
cdr	I-Language
can	O
be	O
given	O
short	O
and	O
more	O
or	O
less	O
pronounceable	O
names	O
of	O
the	O
same	O
form	O
.	O
</s>
<s>
In	O
Lisp	B-Language
,	O
(	O
cadr	O
'	O
(	O
1	O
2	O
3	O
)	O
)	O
is	O
the	O
equivalent	O
of	O
(	O
car	O
(	O
cdr	O
'	O
(	O
1	O
2	O
3	O
)	O
)	O
)	O
;	O
its	O
value	O
is	O
2	O
.	O
</s>
<s>
Most	O
Lisps	B-Language
,	O
for	O
example	O
Common	B-Language
Lisp	I-Language
and	O
Scheme	B-Language
,	O
systematically	O
define	O
all	O
variations	O
of	O
two	O
to	O
four	O
compositions	B-Application
of	O
car	B-Language
and	I-Language
cdr	I-Language
.	O
</s>
<s>
Many	O
languages	O
(	O
particularly	O
functional	B-Language
languages	I-Language
and	O
languages	O
influenced	O
by	O
the	O
functional	B-Language
paradigm	I-Language
)	O
use	O
a	O
singly	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
as	O
a	O
basic	O
data	B-General_Concept
structure	I-General_Concept
,	O
and	O
provide	O
primitives	O
or	O
functions	O
similar	O
to	O
car	B-Language
and	I-Language
cdr	I-Language
.	O
</s>
<s>
In	O
Lisp	B-Language
,	O
however	O
,	O
the	O
cons	B-Protocol
cell	O
is	O
not	O
used	O
only	O
to	O
build	O
linked	B-Data_Structure
lists	I-Data_Structure
but	O
also	O
to	O
build	O
pair	O
and	O
nested	O
pair	O
structures	B-General_Concept
,	O
i.e.	O
</s>
<s>
the	O
cdr	O
of	O
a	O
cons	B-Protocol
cell	O
need	O
not	O
be	O
a	O
list	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
most	O
other	O
languages	O
provide	O
different	O
primitives	O
as	O
they	O
typically	O
distinguish	O
pair	O
structures	B-General_Concept
from	O
list	O
structures	B-General_Concept
either	O
typefully	O
or	O
semantically	O
.	O
</s>
<s>
Particularly	O
in	O
typed	O
languages	O
,	O
lists	O
,	O
pairs	O
,	O
and	O
trees	B-Application
will	O
all	O
have	O
different	O
accessor	O
functions	O
with	O
different	O
type	O
signatures	O
:	O
in	O
Haskell	B-Language
,	O
for	O
example	O
,	O
car	B-Language
and	I-Language
cdr	I-Language
become	O
fst	O
and	O
snd	O
when	O
dealing	O
with	O
a	O
pair	O
type	O
.	O
</s>
<s>
Exact	O
analogues	O
of	O
car	B-Language
and	I-Language
cdr	I-Language
are	O
thus	O
rare	O
in	O
other	O
languages	O
.	O
</s>
<s>
Clojure	B-Language
uses	O
first	O
instead	O
of	O
car	O
and	O
next	O
or	O
rest	O
instead	O
of	O
cdr	O
.	O
</s>
