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

Issue: LOAD-TIME-EVAL (Version 6)



   Date: Wed, 21 Sep 88 15:58 EDT
   From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>

   Also, I am concerned about how the "right thing" can be done with the
   env argument in the case of

    (EVAL-WHEN (EVAL COMPILE LOAD)
      (DEFUN FOO (X) '(X #,(SQRT 3))))

   In a file compiler, the #, must read in a way that is acceptable to the
   compiler's runtime environment (compile to core) and the compiler's file
   environment (compile to file). And this decision must be made at
   readtime.

   If instead you wrote:

    (EVAL-WHEN (EVAL COMPILE LOAD)
      (DEFUN FOO (X) #,`(X ,(SQRT 3))))

   and #, expanded into a LOAD-TIME-VALUE expression, then the compile to
   core operation could treat the LOAD-TIME-VALUE special form in one way
   and the file compiler could treat the LOAD-TIME-VALUE special form
   another way and things would work nicely as a natural result of the
   accessibility of the lexical environment from the special form.

This should work:

 (EVAL-WHEN (EVAL COMPILE LOAD)
   (DEFMACRO LIST-FOR-FOO (&ENVIRONMENT ENV)
     `(X ,(MAKE-LOAD-TIME-CONSTANT '(SQRT 3) ENV)))
   (DEFUN FOO (X) (LIST-FOR-FOO)))