[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Damaged literals?
- To: straz (Steve Strassmann)
- Subject: Re: Damaged literals?
- From: bill (Bill St. Clair)
- Date: Mon, 3 Oct 1994 17:35:41 -0500
- Cc: paul_hasse@NSDGATE3.nsd.fmc.com (paul hasse), info-mcl@cambridge.apple.com
At 2:12 PM 9/30/94, Steve Strassmann wrote:
>At 2:57 PM 9/30/94, paul hasse wrote:
> >In the following function, I replace two elements in a list....
> >
> >? (defun test ()
> > (let ((x '(1 2 3 4 5 6 7 8 9)))
>
>Yes, there's a subtle but important difference between that and
>
>(defun test ()
> (let ((x (list 1 2 3 4 5 6 7 8 9)))
> ...
Straz showed you how to avoid the problem. I'm chiming in to tell
you why your code "is an error".
On p. 115 of CLtL2, it says: "X3J13 voted in January 1989 (36) to
clarify that it is an error to destructively modify any object
that appears as a constant in executeable code, whether within
a QUOTE sepcial form or as a self-evaluating form."
Page 5 defines the phrase "it is an error".