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

Re: Issue DEFCONSTANT-VALUE



I've just thought of another problem with this proposal: it does not
address the issue of what environment the constant value gets
evaluated in.  Presumably this must be the null lexical environment at
compile time; so it should be the null lexical environment at run time
also.  That would make DEFCONSTANT even more incompatible with
DEFPARAMETER and DEFVAR.

I'd like to suggest a compromise on this issue.  How about dropping
this proposal if I add an item to my proposal for issue
COMPILE-ENVIRONMENT-CONSISTENCY, to the effect that the compiler can
wire in the values of constants that have been defined with
DEFCONSTANT in the compilation environment?  (I suspect that most
implementations do so already; I just plain forgot to put it on the
list before.)

That would allow your hairy example with lots of EVAL-WHENs and #.:

    (eval-when (eval compile load)
      (defconstant max-index 100))
    (eval-when (eval compile load)
      (defconstant max-count #.(1+ max-index)))

to be written using a single EVAL-WHEN:

    (eval-when (eval compile load)
      (defconstant max-index 100)
      (defconstant max-count (1+ max-index)))

-Sandra
-------