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

Eval-When -- a radical view



    
        I searched through our system sources looking for all uses of 
        EVAL-WHEN. 
        Nearly all uses involved one of two situations lists:
         (COMPILE LOAD EVAL)
         (COMPILE EVAL)

In our implementation, the most common situation for eval-when is
(compile eval). This is used to exclude macros, constants, etc that
are compiled in to a delivered system. Another common one is
(load eval), which is used within expansions of macros to force loading
of runtime support: e.g.,

  (defmacro mac (....)
   `(progn
      (eval-when (load eval) (require "runtime-support"))
      ...rest of expansion here....))

This is nice because in the file header you only have to require the
module that defines the macros, via: 
(eval-when (compile eval) (require "the-macros")) You don't have to
know where the runtime support lives, or use autoloading or anything.

There are almost no uses of (compile eval load) anywhere.

I am of the opinion that we should define what EVAL-WHEN does, and
not chuck it out in favor of new constructs, like EVAL-EARLY, etc.


...mike beckerle