Subject: Re: Two names for the same variable
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 24 Feb 2007 05:04:32 -0600
Newsgroups: comp.lang.lisp
Message-ID: <2tydnXoQwMldhn3YnZ2dnUVZ_qK3nZ2d@speakeasy.net>
Vassil Nikolov  <vnikolov+usenet@pobox.com> wrote:
+---------------
| rpw3@rpw3.org (Rob Warnock) said:
| | Vassil Nikolov  <vnikolov+usenet@pobox.com> wrote:
| | +---------------
| | | ...
| | | As soon as a form is evaluated, any literals in it may be placed in
| | | read-only memory (perhaps as a side effect of compilation on the fly).
| | +---------------
| 
| | A conservative reading of CLHS glossary item for "literal"
| | would suggest tightening that to say:
| 
| |     As soon as a form is READ any literals in it may be
| |     placed in read-only memory...
| 
|   Right.  Thanks.  ("Form" is of course a key word here, i.e. this
|   is about READ called from within the language processor (interpreter
|   or compiler), not about just any call to READ.)
+---------------

Well, some more wizardly CLHS maven(s) than I may chime in here,
but at this point I'm not sure the loophole you seem to be looking
for is actually there. READ reads characters from an input stream
(any input stream) and returns objects. If the characters that
it reads are of the syntax of "literal objects", then it seems
that the read-only rule applies there, too. I'm less certain
about any list structure that might be wrapped *around* such
literal objects, but my gut feeling is that it's legitimate for
an implementation to consider *all* objects returned by READ[1]
to be "literal objects", including list structure, since their
external representaions were literally present in the input stream.


-Rob

[1] Well, with the exception of objects explicitly constructed
    by read-time evaluation. E.g., I'm of the opinion that the
    object returned by #.(COPY-SEQ "abcde") should be mutable.

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607