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

Re: Issue DEFCONSTANT-VALUE (V2)



> I'm still not clear on whether you want the run-time evaluation of the
> value form to happen in a null lexical environment as well.

I was assuming that, but that could be awkward to implement now that I
think about it.

>    If not, I
> think the proposal should include some strong warnings about it, since
> that would be a likely source of getting different values at load time
> than at compile time.

Agreed.

>   Lucid also conforms to this proposal.
> 
> My understanding of JonL's comments on this were that Lucid only does
> compile-time evaluation of the value form when the DEFCONSTANT appears
> at top-level.

That was my intent, even if it didn't come out that way.

>   If you're going to go through the work
> of implementing a way to temporarily remember values of constants
> seen by the compiler, is one call to CONSTANTP going to make any
> difference?

But to really do it well, it wouldn't be just a call to CONSTANTP, it
would be a code walk of the expression to see if all of the functions are
known to be safe and all of the terms are constants.