I wrote a macro similar to RESTART-CASE called SUPER-RESTART-CASE. :)
There are a few differences.
The :REPORT option accepts the syntax (STRING ...) which is a
shorthand for (LAMBDA (STREAM) (FORMAT STREAM STRING ...)), which is a
nice convenience to augment the plain :REPORT STRING syntax.
But more importantly, the SUPER-RESTART-CASE clauses do not perform a
non-local exit automatically. They execute in the dynamic context of
the INVOKE-RESTART call, just like the bodies of the RESTART-BIND
lambdas. The programmer controls when the non-local exit takes place,
using a special form called UNWIND, which is like a PROGN preceded by
a non-local exit.
Example:
(super-restart-case
(error "foo!")
(continue () :report ("blah ~a" 42)
(unwind
1 2 3))) ; super-restart-case yields 3
; if control ends up here
There is a second macro called RETRY which causes the
SUPER-RESTART-CASE block to be re-executed. This is convenient for
restarts that want to re-evaluate the expression which blew up after
making or allowing for a correction to be made.
(super-restart-case
(error "Whack!")
(again () :report "Thank you sir, may I have another!"
(retry)))
URL: http://users.footprints.net/~kaz/super-restart-bind.lisp