#653 eq load-time-value forms get coalesced

open
Bruno Haible
clisp (525)
5
2012-12-19
2012-12-19
stassats
No

When the following is compiled with compile-file
(defun foo ()
(eq #1=(load-time-value (cons 1 2)) #1#))

the result of (foo) becomes T. And this usually manifests in macros.
CLHS states

"If nil [read-only-p] (the default), the result must be neither copied nor coalesced; it must be considered to be potentially modifiable data."
http://www.lispworks.com/reference/HyperSpec/Body/s_ld_tim.htm

The code which appears to be responsible for this is
http://clisp.hg.sourceforge.net/hgweb/clisp/clisp/file/696bfff6e3d1/src/compiler.lisp#l8116

The patch that fixes it for me is attached, but not sure about other implications of such a change.

Discussion

  • stassats
    stassats
    2012-12-19

     
    Attachments