home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.lang.lisp
- Subject: CAR and CDR (was Re: Why Isn't Lisp a Mainstream Language?)
- Date: 23 Jan 1993 19:28:39 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 33
- Message-ID: <1js697INNjh@early-bird.think.com>
- References: <1993Jan21.230642.18561@netlabs.com> <19930122162651.0.SWM@SUMMER.SCRC.Symbolics.COM>
- NNTP-Posting-Host: gandalf.think.com
-
- In article <19930122162651.0.SWM@SUMMER.SCRC.Symbolics.COM> SWM@stony-brook.scrc.symbolics.com (Scott McKay) writes:
- >I personally think CAR and CDR could have been flushed from the
- >language, since FIRST and REST do the exact same thing.
-
- FIRST and REST only make sense when a cons is being used as a chain in a
- list. CAR and CDR make much more sense for conses being used as pairs.
- Their lack of preexisting semantics fits in with the abstract nature of
- conses: calling them CONS-PART1 and CONS-PART2, for instance, would imply
- an ordering to the components that doesn't necessarily exist. Flushing CAR
- and CDR would make almost as little sense as flushing NOT because it's
- equivalent to NULL.
-
- Perhaps conses as fundamental data types should have been removed when
- DEFSTRUCT was included in the standard. CONS could be defined as:
-
- (defstruct (cons (:conc-name ""))
- car cdr)
-
- > What machines
- >directly execute mapping operators? Reduction operators?
-
- Connection Machines!
-
- > What machines
- >directly execute generic arithmetic, including integers, large integers,
- >floating point, and ratios?
-
- Lisp Machines?
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-