next up previous
Next: Implications for other languages Up: Stages in Common Lisp Previous: A condition hierarchy

Alternatives to simple handling in CL

(Simple = allowing one to substitute a value for a function call, and then continue.)

Any other way to restart? restart-case provides alternatives. (In an interactive system), "anonymous restarts" give an opportunity to specify prompting from the debugger: e.g. do you want to recompute the function with different args? do you want to return an specified value? [computed in the context of the restart-case..] e.g.

(restart-case <compute-this>  (nil <restart1>)(nil <restart2>))
gives 2 options.

named restarts (trivial example):

  (restart-case  (invoke-restart 'foo 3)
     (foo (x) (+ x 1)))

It is possible to use find-restart to see if a handler exists, and even (recursively) if that restart could be restarted (etc).



Richard J. Fateman
Sat Aug 15 13:32:36 PDT 1998