[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inconsistency in backquote spec?



   Date: Mon, 28 Nov 88 20:44 EST
   From: Michael Greenwald <Greenwald@stony-brook.scrc.symbolics.com>

   (setq d '(a . b))

   '`(,@d) => `(a . b) or `(a)?

   If you read CLtL, pg 350. it says that it's equivalent to
   `(,@d . nil)
   which is 
   (append [,@d] 'nil)
   (append d 'nil)
   which suggests the correct value is `(a).

   ...

   Are dotted lists not allowed as values of D?  Is the spec on pg 350
   correct, and the examples on pg. 351 incorrect?

   I tend to believe the latter.  In which case, all of the readers I tried
   are incorrect.  I'm not going to change the Genera reader, though, until
   I hear from this list, in case my brain is just wedged.  Can someone
   either deconfuse or support me?

You raise some good points here.  At first I was certain that the book
was not consistent, but now I have the following language lawyer's
argument:

The spec for APPEND says that all arguments but the last must be lists.
The comment about the last argument makes it clear that the others
are meant to be proper lists; see also the middle paragraph of page 27.
Therefore dotted lists are not allowed as values for D.

The examples on page 351 are also correct.  Once you are given that
D may not be dotted, and given that the result of a backquoted
expression may or may not make copies, then the examples shown are
correct optimizations.

--Guy