[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
erratum: logic error on p.125
Date: Thursday, 19 Sep 85 17:58:26 PDT
From: S Sridhar <sridhar%tekchips%tektronix.csnet@CSNET-RELAY.ARPA>
On p.125 about the middle of the page in the ribcage-lookup function
in the scope of the second do:
REPLACE (v (cdar r) (cdr v))) BY (v (cadar r) (cdr v)))
[the cdar is replaced by cadar]
Thank you for your comment. The code as it stands is consistent with
the description in the preceding paragraph, and in particular with the
remark that the ribcage resembles an association list.
There are two styles of coding that I have observed people using in LISP
code with respect to associating lists. One is the traditional a-list:
((A . B) (C . D) (E . F))
The other is similar, but uses 2-lists instead of dotted pairs:
((A B) (C D) (E F))
The first saves CONS cells, but is more complicated to print. The
second looks neater, but takes more memory space and requires extra CAR
operations to access. I think this latter style has been promulgated by
the SCHEME community in particular.
Either is fine, but the example was intended to use the first style of
list. Perhaps more explanation is needed for this example.