Common Lisp the Language 2nd Edition


next up previous contents index
Next: Comparison of Restarts Up: Survey of Concepts Previous: Named Restarts

29.3.8. Restart Functions

change_begin
For commonly used restarts it is conventional to define a program interface that hides the use of invoke-restart. Such program interfaces to restarts are called restart functions.

The normal convention is for the function to share the name of the restart. The pre-defined functions abort continue muffle-warning store-value and use-value are restart functions. With use-value the above example of handler-bind could have been written more concisely as

(handler-bind ((unbound-variable
#'(lambda (c)     ;Argument c is a condition
(use-value (cell-error-name c)))))
body)


change_end


AI.Repository@cs.cmu.edu