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

Re: issue QUOTE-MAY-COPY, version 2



> Date: Sat, 31 Dec 88 18:20:56 GMT
> From: Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>
> 
> Could it be that something like the following might return NIL?
> 
>    (let ((a (gensym)))
>      (eql (funcall (compile nil `(lambda () ',a)))
>           (funcall (compile nil `(lambda () ',a)))))
> 
> Or even
> 
>    (let ((a (gensym)))
>      (eval `(eql ',a ',a)))

Rather than making an exception for gensyms, I'm inclined to believe
that *all* sharing of structures within an expression passed to EVAL,
a function passed to COMPILE, or the entire contents of a file
compiled with COMPILE-FILE ought to be preserved.  I don't think it
would be unreasonable for your first example to return NIL, but I
think the second one ought to return true (regardless of whether the
value of A is a gensym or some other kind of object).  

This really falls under issue CONSTANT-CIRCULAR-COMPILATION, although
both of the existing proposals on this issue say that sharing is not
required to be preserved (by analogy with *PRINT-CIRCLE*, which is
only required to detect circularity and not sharing).  We now seem to
be moving away from the idea of COMPILE-FILE treating constants like
PRINT, however, so maybe it's time to consider this as an alternate
proposal. 

-Sandra
-------