From ... Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!newsfeed.stueberl.de!news.netway.at!nmaster.kpnqwest.net!nnum.kpnqwest.net!EU.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: modify quoted list (was Re: weird function behavior) References: <3230400393774701@naggum.net> <878z5snth3.fsf_-_@cs.uga.edu> <3CFFBC74.68A6C140@smi.de> Mail-Copies-To: never From: Erik Naggum Message-ID: <3232481348218721@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 25 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 07 Jun 2002 23:29:26 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1023492566 193.71.199.50 (Sat, 08 Jun 2002 01:29:26 MET DST) NNTP-Posting-Date: Sat, 08 Jun 2002 01:29:26 MET DST Xref: archiver1.google.com comp.lang.lisp:34570 * Thomas F. Burdick | In my mental model of the Lisp world, anything returned by QUOTE is in | read-only space. So for example, in '(1 2 (a (foo . bar) c) 4 5), all | nine of those cons cells are read-only. The compiler I'm working on | expresses this literally; it goes to some lengths to make sure that all | literal data is in read-only memory, so you'll get an error if you try to | modify it. It would be really nice if the major lisp compilers did this. Are all self-quoting objects that are created by the reader turned into read-only objects or do you make a special case for quote? The typical example is the literal string. The above could easily be read to imply that only the special operator quote produces literals, which you may not have meant. I see a definite problem with identifying, remembering, and maintaining the creation time of objects. Unless you _only_ arrange for the loader to create read-only objects out of the literals that survive compilation, I see a truckload of problems here. E.g., the reader may well cause portions of an evaluated back-quoted form to share structure with the original list. Incidentally, if you treat all pathnames as read-only objects (since there are no mutators for them), you could also intern them and save on translation to namestrings. -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. 70 percent of American adults do not understand the scientific process.