[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: CONSTANT-SIDE-EFFECTS (no proposal)
- To: Gray@DSG.csc.ti.com
- Subject: Issue: CONSTANT-SIDE-EFFECTS (no proposal)
- From: Jon L White <firstname.lastname@example.org>
- Date: Tue, 1 Nov 88 23:45:07 PST
- Cc: masinter.pa@XEROX.COM, KMP@SCRC-STONY-BROOK.ARPA, CL-Cleanup@SAIL.STANFORD.EDU
- In-reply-to: David N Gray's message of Fri, 28 Oct 88 11:46:10 CDT <2803049170-5088086@Kelvin>
re: it is common practice to do things like
(DEFVAR *X* '(A B C))
(SETF (SECOND *X*) 'Z)
Perhaps it would be better to say (DEFVAR *X* (COPY-LIST '(A B C))) but
requiring that would invalidate a lot of existing code. I don't think
that this inconsistency is really a problem . . .
(DEFCONSTANT X '(A B C))
(SETF (SECOND X) 'Z)
Is this inconsistency not really a problem either??
re: . . . Note that the
object file loader knows that a value is only used as a constant before it
creates it, so it can create it in the proper memory area, but READ does
not have any such context information, so write-protecting constants in
the interpreter or in-memory compilation means copying them.
Many people assume that the definition of QUOTE in (QUOTE <x>) must be simply
to return the program fragment <x> exactly as read in by the reader. I have
an interpreter design in mind that does something else -- namely it "caches"
an equivalent copy of <x>. Except for symbols (and packages, and classes)
the results of QUOTE would never be simply the s-expression that was read-in.
At least you only need one copy in the constant area (where equivalence
of copies is something more featureful than EQUAL).
-- JonL --