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


Date: 5 Jan 89 21:41 PST
 From: masinter.pa@Xerox.COM
Subject: Re: issue LOAD-TIME-EVAL
In-Reply-To: sandra%defun@cs.utah.edu (Sandra J Loosemore)'s message of
 Tue, 3 Jan 89 15:28:30 MST
To: cl-compiler@sail.stanford.edu
Cc: masinter.pa@Xerox.COM
Message-Id: <890105-214203-187@Xerox>

> I don't think      (CONS #1=(LOAD-TIME-VALUE (COMPUTE-IT)) #1#)
> is a good example; you'd do better to say, e.g.,
> (defmacro cons-self (x) `(cons ,x ,x))
> (cons-self (load-time-value (compute-it)))
> the macro expansion of load-time-value might contain EQ structures. This is
> a pretty subtle point that really has to do with macro-expansion-caching --
> you'd be better off explaining what you're outlawing here.

It doesn't really have anything to do with macro expansion caching.
It is true that macro expansion is the most likely way of getting
multiple references to a LOAD-TIME-VALUE form, so your example
probably is better.  However, the idea here is to clarify what the
statement in a previous paragraph means about the interpreter being
allowed to evaluate a LOAD-TIME-VALUE form "only once".  It's
legitimate to do a code walk before evaluation, but it's not
legitimate to cache LOAD-TIME-VALUE forms and resulting values and do
a lookup based on EQness of source code expressions.