Xref: utzoo comp.lang.lisp:3702 comp.lang.scheme:1714 Newsgroups: comp.lang.lisp,comp.lang.scheme Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!hellgate.utah.edu!cdr.utah.edu!moore From: moore%cdr.utah.edu@cs.utah.edu (Tim Moore) Subject: Re: Virtues of Lisp syntax Date: 22 Sep 90 14:43:02 MDT Message-ID: <1990Sep22.144303.2945@hellgate.utah.edu> Organization: University of Utah CS Dept References: <10722@life.ai.mit.edu> <20501@well.sf.ca.us> <1990Sep18.180829.8801@hellgate.utah.edu> <20692@well.sf.ca.us> In article <20692@well.sf.ca.us> jjacobs@well.sf.ca.us (Jeffrey Jacobs) writes: > >Larry Masinter wrote: >>>>[As a side note, many learning LISP programmers frequently do >>>> encounter self-modifying code and are mystified by it, e.g., >>>> (let ((var '(a b c))) >>>> ... >>>> (nconc var value)) ... >And Tim Moore wrote: ... >>>It's not legal Common >>>Lisp code, because the constant may be in read-only memory. > >Correct me if I'm wrong, but it seems to me that this *is* legal and >that the compiler should specifically *not* allocate quoted lists such >as that to read-only memory! For better or worse, this is from CLtL2, pg 115: X3J13 [the body specifying ANSI Common Lisp] voted in January 1989 to clarify that it is an error to destructively modify any object that appears as a constant in executable code, whether within a quote special form or as a self-evaluating form. I'm not sure where this was specified in the orginal CLtL; obviously it wasn't specified too clearly or X3J13 wouldn't have needed to clarify this point. >Jeffrey M. Jacobs >ConsArt Systems Inc, Technology & Management Consulting >P.O. Box 3016, Manhattan Beach, CA 90266 >voice: (213)376-3802, E-Mail: 76702.456@COMPUSERVE.COM Tim Moore moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore "Ah, youth. Ah, statute of limitations." -John Waters