Newsgroups: comp.lang.lisp.mcl
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!gw2.att.com!pacbell.com!amdahl.com!netcomsv!uu3news.netcom.com!netcom.com!alderson
From: alderson@netcom.com (Richard M. Alderson III)
Subject: Re: Thx almost everyone
In-Reply-To: reti@cambridge.apple.com's message of 17 Apr 1995 08:42:32 -0400
Message-ID: <aldersonD77IGw.Ds2@netcom.com>
Reply-To: alderson@netcom.com
Fcc: /u52/alderson/postings
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <199504171542.IAA03175@ministry.cambridge.apple.com>
Date: Tue, 18 Apr 1995 01:22:08 GMT
Lines: 35
Sender: alderson@netcom20.netcom.com

In article <199504171542.IAA03175@ministry.cambridge.apple.com>
reti@cambridge.apple.com (Kalman Reti) writes:

>At 19:03 4/16/95 -0500, Ken Tilton wrote:

>>BTW, what's this "car" and "cdr" I see all over the place?

>They are old names for "first" and "rest".  The date back to the
>implementation of Lisp on an old IBM machine (704 I believe) where the two
>halves of a cons were kept in two registers.  CAR stands for "contents of
>address register" and represents the instruction used to get the first element
>of the cons.  CDR is similarly contents of decrement register.

It was the 704.

The 704 was a 36-bit machine, with 15-bit addresses.  A memory word or register
could therefore hold two addresses, along with a 3-bit index-register spec and
a 3-bit tag.  The two 15-bit portions were used by looping instructions to hold
the ADDRESS and the DECREMENT.  So the correct reading of CAR and CDR is
"Contents of Address (resp. Decrement) *part* of Register."

In the original implementation of LISP, done as a set of FORTRAN subroutines,
you find not only CAR and CDR, but also CTR and CXR.  John McCarthy has stated
that these turned out not to be very useful.

>Their use is considered old-fashioned at best (and poor style at worst) these
>days.

And in some Lisps are still the default:  E-Lisp, for example.  Which may or
may not be in contradistinction to Mr. Reti's statement.
-- 
Rich Alderson   You know the sort of thing that you can find in any dictionary
                of a strange language, and which so excites the amateur philo-
                logists, itching to derive one tongue from another that they
                know better: a word that is nearly the same in form and meaning
                as the corresponding word in English, or Latin, or Hebrew, or
                what not.
                                                --J. R. R. Tolkien,
alderson@netcom.com                               _The Notion Club Papers_
