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

Issue: CONSTANT-SIDE-EFFECTS



    Date: 20 Nov 87 11:49 PST
    From: Masinter.pa@Xerox.COM

    Some additional puzzles:

    - - - - - -
    (defvar a (list 1 2 3 4))
    (defconstant b a)
    (setf (car a) 4)

I don't know what I think about this one, it's real nasty.  The first
paragraph on CLtL p.69 probably says that defconstant is not allowed
to make a fresh copy of the list; if true, this is code certainly an
error, although the error might be rather difficult to detect in any
practical implementation.

    - - - - - -

    (nconc `(,x 5 6 7) y)

I prefer to call this an error, on the grounds that ` should be as much
like ' as possible.  For extra help in thinking about this, try

    (nconc `(5 6 7) y)