[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Taking CAR and CDR of hunks
- To: KRONJ at MIT-MC
- Subject: Taking CAR and CDR of hunks
- From: Jon L White <JONL at MIT-MC>
- Date: Sun, 26 Jul 81 19:27:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 26 July 1981 15:27-EDT
Date: 25 July 1981 23:46-EDT
From: David Eppstein <KRONJ at MIT-MC>
To: BUG-LISP at MIT-MC
(car '(foo.)) => #777777
(cdr '(foo.)) => FOO
. . .
Why are the CAR and CDR of a one-element hunk switched from what I
would expect? Maybe they should both return FOO, in my example above.
This example of 1-element hunks is just another reason why the idea of
treating hunks as generalized lists is bad. Interpretively, at least,
CXR and RPLACX will certify the length before trying to access an i'th
element; CDR was defined to get the 0'th element, and CAR the 1'st element;
possibly extra code could be added to CAR to check for hunks of length 1.