next up previous
Next: Interlisp Up: Hooks in Lisp Previous: Hooks in Lisp

Common Lisp

  In Common Lisp [13] expression evaluation and function application have associated hooks. The hooks are in effect when two special variables, *evalhook* and *applyhook*, are bound to user-defined functions. If, for instance, *evalhook* is temporarily bound to the function f, such as in

(let ((*evalhook* 'f))
(eval expression))

then instead of evaluating expression the function f is called with two arguments: the construct (eval expression) and the lexical environment in which free names of expression can be meaningfully interpreted. According to Common Lisp the Language [13], the eval hook and apply hook mechanisms of Common Lisp are primarily designed for the implementation of Lisp development tools, such as steppers, tracers, and debuggers, within Common Lisp itself. The mechanism makes it possible to get control at critical places during evaluation of an expression, in order to report on, or otherwise utilize the available information about the state of the computation.

Kurt Noermark
Wed Mar 6 09:44:24 MET 1996