Ok, I need to rewrite this question.
If I go:
CL-USER> whatever
I get this in the debugger frame:
The variable WHATEVER is unbound.
[Condition of type UNBOUND-VARIABLE]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING {C0C6CF9}>)
...
Therefore, I should be able to do this:
(handler-case
whatever
(unbound-variable (e) (invoke-restart 'retry)))
Yet it yields:
No restart RETRY is active.
[Condition of type SB-INT:SIMPLE-CONTROL-ERROR]
...
What am I missing?
The ABORT retry does work correctly; thanks hans and Svante for pointing that out. The others - retry, terminate-thread, etc - all error out.
I've also tried hitting e in the debugger and running INVOKE-RESTART directly. Same result with one exception: the low-level example in this answer works like I think it should:
Eval in frame (COMMON-LISP-USER)> (invoke-restart 'go-on)
returns to the prompt without complaint. The high-level example will only restart correctly when selected by hand from the restarts menu.
The star in front of the restart 1 in your output indicates that this restart will be invoked by SLIME's [q]uit command. The name of the restart is 'ABORT, so in order to invoke it, use this:
(handler-case
whatever
(unbound-variable (e) (invoke-restart 'abort)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With