[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proposal LOAD-TIME-EVAL:REVISED-NEW-SPECIAL-FORM



    Date: Wed, 21 Sep 88 13:48 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
    
    ... All constants are created at load time.  Think about it; the output
    file from COMPILE-FILE doesn't contain objects, it contains instructions
    to the loader telling it how to create objects. ...

Not just how to create objects -- also to -find- objects. This is at the root
of my concern about whether #,(form) returns a modifiable object.

If you just write '(2 3 4) the compiler must figure out how to do the
construction from your declarative reference to the conjured structure.
It can't tell if you wrote:  '#.(LOOP FOR X FROM 2 TO 4 COLLECT X) or
'#.(CDR FOUR-THINGS) or '(2 3 4) so it just does the best it can based
on the final result.

On the other hand, the #, facility provides you with a way to advise the
compiler about the actual code to be used in procuring the object. The
compiler can tell if sharing, modifiability, circularity, etc. is 
important to you because it can blindly follow the instructions which you
have carefully written to express your exact requirements.

#, is not about constants. It is simply about delayed decision-making. 
If I delay a decision until runtime, I don't have to return an immutable
object from a function. Why should I have to return an immutable object
if I can make the decision a little earlier (at load time)?

Indeed, the only reason that decisions made in the compiler can be construed
to be constants is exactly this unfortunate artifact of file compilation
which you address. If the compiler shared a huge address space with all
Lisps for all time, it could output pointers to actual objects and then
decisions about mutable objects could be made in the compiler. We accept
the file-model of a compiler as a limitation of existing systems and allow
anything done on the `compiler side' to be subject of funny restrictions
needed to allow you to represent your program to a file and have it 
reconstructed, but since #, is not done on the compiler side, it should not
be subject to these restrictions.

    I sure can't understand why this issue is so hard.

Me either. It seems crystal clear to me. :-)