[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: constant folding/smashing
It was an odd sensation to me to read Nick (Gall(?))'s note.
To me, everything he said made sense, down to this paragraph:
> It is this aspect of `constant'ly returning the same (EQ) object that
> is meant in the sentence on pg. 86: "[QUOTE] allows any Lisp object to
> be written as a constant value in a program." It is the value of the
> (QUOTE ...) form that is held constant, not the object itself. The
> same (EQ) object will always be referenced, but that object may be
> modified over time (if it is a composite object).
The problem with this conclusion is that if the storage for constants
is "collapsed" together, it is impossible to know how many constants
are changing if you change a constant. A constant in someone
else's code, even system code, may be changed by your side effect.
This is an intolerable situation, so side-effects on constants
are an error.