[Gbbopen-list] Question about ADD-EVENT-FUNCTION

Dan Corkill corkill at cs.umass.edu
Wed Apr 16 13:16:14 EDT 2008


> Should ADD-EVENT-FUNCTION be put into a EVAL-WHEN block? Like this:
> 
> (eval-when (:load-toplevel :execute)
>    (add-event-function 'initializations 'start-control-shell-event
> 		      ;; Initializations should be done first!
> 		      :priority 100))
> 
> Since ADD-EVENT-FUNCTION is a function but not macro, I think it may  
> be useless to eval on compile-time.
> 
> Am I right?

You are correct (technically), however there is no need for the eval-when.

 From the CL Hyperspec:

Normally, the top level forms appearing in a file compiled with 
compile-file are evaluated only when the resulting compiled file is loaded, 
and not when the file is compiled.

Your eval-when (above) is redundant, as it is exactly the default behavior 
(unless the "top level" form above is inside another top level eval-when form).



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Gbbopen-list mailing list