[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: **DRAFT** issue QUOTE-MAY-COPY
- To: jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK
- Subject: Re: **DRAFT** issue QUOTE-MAY-COPY
- From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Wed, 11 Jan 89 17:57 EST
- Cc: jonl@Lucid.COM, email@example.com, CL-Compiler@SAIL.Stanford.EDU, KMP@STONY-BROOK.SCRC.Symbolics.COM
- In-reply-to: <firstname.lastname@example.org>
Date: Wed, 11 Jan 89 18:54:12 GMT
From: Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>
LOAD-TIME-VALUE might help in all of these cases (whether you want
to modify or just to have a unique object), except that we might
end up deciding that LOAD-TIME-VALUE gives a new object each time
in interpreted code and that QUOTE does not. The situation would
be better in compiled code.
Careful! We won't ever end up deciding that LOAD-TIME-VALUE gives a different
value every time. We may end up deciding that LOAD-TIME-VALUE evaluates
the form every time. The two may or may not be related.
Consider the difference between
(LOAD-TIME-VALUE (LIST 1 2 3))
which will give unique lists every time its evaluated, and so will give
new values if evaluated multiple times and
(LOAD-TIME-VALUE (OR (GETHASH :1-2-3 *MY-CACHE*)
(SETF (GETHASH :1-2-3 *MY-CACHE*) (LIST 1 2 3))))
which is not susceptible to re-evaluation problems [unless I change
*MY-CACHE* somewhere else, of course].
Personally I think this whole discussion is mis-guided. QUOTE is not what
copies. The process of turning `source code' into `executable gunk' may
not preserve EQ-ness, but QUOTE itself will. The effect may appear as if
QUOTE is not doing its job, but QUOTE will be busy doing the best it can.
The number of copies made should not exceed the number of transformations
made between `source code' and `executable gunk' ... Normally that will be
1, but in the case of explicit calls to EVAL it may be greater since those
force a transformation -- or maybe many transformations -- at runtime.
In many ways reminds me of discussions about "e and `functions which
don't evaluate their arguments': functions just get called with arguments.
It quickly becomes clear when APPLY becomes involved that nothing a
function does can keep its arguments from being evaluated if the caller
wants to evaluate them. It may be useful to think of functions as evaluating
their arguments or not, but it's sloppy. Similarly here, if you want to
talk about QUOTE copying or not copying, that's ok if you can keep it
straight (though it doesn't sound to me like some people can), but in my
opinion it's sloppy and prone to lead you down alleys you oughtn't bother
I'm not so much talking to Jeff here, as I am talking to some of the others
in this discussion. It's just that Jeff's notes keep reminding me and this
is the first chance I've had to pipe in for a bit...