sb-mop:generic-function-methods generic setf
inconsistent-merge-error class
instance-initargs generic
+ invoke-associated-restart function
it
lbuild-add function
lbuild-add-list function
partial-order-minima function
print-ugly-stuff function
ref function setf
+ simple-control-error class
symbolicate function
update-position function
whitespace-char-p function
cl:condition
cl:serious-condition
cl:error
+ cl:control-error
+ simple-control-error [cl:simple-error]
inconsistent-merge-error
+ cl:simple-error [cl:simple-condition]
+ simple-control-error [cl:control-error]
+ cl:simple-condition
+ cl:simple-error [cl:error]
+ simple-control-error [cl:control-error]
cl:standard-object
sb-mop:metaobject
sb-mop:specializer
@[[ :read-only @<read-only-flag> @]]}
\end{describe}
+\begin{describe}{cls}
+ {simple-control-error (control-error simple-error)
+ \&key :format-control :format-arguments}
+\end{describe}
+
\begin{describe}{fun}
{designated-condition
\=@<default-type> @<datum> @<arguments> \\
\nlret @<condition>}
\end{describe}
+\begin{describe}{fun}
+ {invoke-associated-restart @<restart> @<condition> \&rest @<arguments>}
+\end{describe}
+
\begin{describe}{mac}
{default-slot (@<instance> @<slot> @[@<slot-names>@]) \\ \ind
@<form>^*}
(t
(error "Unexpected condition designator datum ~S" datum))))
+(export 'simple-control-error)
+(define-condition simple-control-error (control-error simple-error)
+ ())
+
+(export 'invoke-associated-restart)
+(defun invoke-associated-restart (restart condition &rest arguments)
+ "Invoke the active RESTART associated with CONDITION, with the ARGUMENTS.
+
+ Find an active restart designated by RESTART; if CONDITION is not nil,
+ then restrict the search to restarts associated with CONDITION, and
+ restarts not associated with any condition. If no such restart is found
+ then signal an error of type `control-error'; otherwise invoke the restart
+ with the given ARGUMENTS."
+ (apply #'invoke-restart
+ (or (find-restart restart condition)
+ (error 'simple-control-error
+ :format-control "~:[Restart ~S is not active~;~
+ No active `~(~A~)' restart~]~
+ ~@[ for condition ~S~]"
+ :format-arguments (list (symbolp restart)
+ restart
+ condition)))
+ arguments))
+
;;;--------------------------------------------------------------------------
;;; CLOS hacking.