SLUG mail archive

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

Ensuring modifiable references within a backquoted template



    Date: Mon, 23 Apr 90 15:11 CDT
    From: lgm@ihlpf.att.com
    always yields the identical list structure.  On the other hand,
    applying the comma to a function call such as

	    `(A (B ,(IDENTITY NIL))

    indeed results in multiple, safely modifiable list structures.
    Can I depend on this behavior portably, or could a Common Lisp
    implementation thwart my intent by "intelligently"
    constant-folding (IDENTITY NIL) into NIL anyway?  If I were to
    locally declare IDENTITY to be NOTINLINE, would I then be "safe"
    (though slightly slower)?

I suggest using

(locally (declare (notinline copy-tree))
  `(A (B ,(COPY-TREE NIL))))

instead.  It's both less likely to be constant folding, and more
indicative of your actual intent.


Follow-Ups:

Main Index | Thread Index