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

NCONC and LAST of locatives



Suppose a macro initializes the variable LET to '(LET () ...)
preparing to NCONC zero or more lists of variable-names onto
the list which is (CADR LET).  One might try initializing
POINTER to (LOCF (CADR LET)), and then for each list of
new-names (NCONC POINTER new-names), on the
theory that NCONC cdrs until the cdr is () and then RPLACDs.
This currently fails on the the LispM because NCONCing the
locative is apparently a no-op.  Should it be?

Recalling that RPLACD affects locatives, I tried
(RPLACD (LAST ...) ...) in place of NCONC.  This does the right
thing the first time (thereby differing from NCONC!),
because (LAST POINTER) was POINTER.  Unfortunately, it
remains thus for non-null (CDR POINTER).  Admittedly, this is
curable by the (probably more efficient anyway) stratagem of
(RPLACD (LAST POINTER) (SETQ POINTER new-names)), but should this
be necessary?
-------