[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
inconsistency in backquote spec?
Date: Tue, 29 Nov 88 00:10:53 PST
From: Jon L White <firstname.lastname@example.org>
re: However, the example at the bottom of page 350 suggest alternate
"legitimate interpretations" continued on the top of pg 351. All of
them except the first, consider (APPEND .... D NIL) to be equivalent to
(APPEND ... D), which isn't true if D can be a dotted list.
[This may be a question about "standard lists" more than about backquote.]
I remember some sleeping dogs about APPEND -- all arguments except the last
are required to be "lists". Since APPEND has to copy the next to last
argument, it must cdr down to the last cell of the list; thus it should
complain about non-standard lists. [The permission to use non-standard
lists is primarily when the operation of interest will not cdr down to
the last cell, and hence it would be a moot question.]
Long long ago, Lucid made the decision to make non-standard lists acceptable
just about everwhere that "lists" are. Thus in Lucid Common Lisp:
(APPEND '(A . B) NIL) ==> (A)
(APPEND NIL '(A . B)) ==> (A . B)
I agree with this (I think there's a CL cleanup that specifies this
behavior for APPEND and NCONC), and therefore the Lucid backquote
implementation is inconsistent with the definition of APPEND.
(setq d '(a . b))
`(,@d . nil)
(append [,@d] 'nil)
(append d 'nil)
(append '(a . b) 'nil)
should be (a), as in your example above.
However, it was (a . b) on the version I tried - I didn't try the APPEND
case itself, so maybe in a later version both were made consistent.
I can't say that I am fully happy with this; but it's very low on my
list of worries today.
-- JonL --