Hi all,
The following works in a raw SBCL session, but not when used with Slime:
(defun call-with-retry-restart (msg thunk) (restart-bind ((retry (lambda () (throw 'retry nil)) :report-function (lambda (stream) (write msg :stream stream)))) (catch 'ok (loop do (catch 'retry (format t "CATCH 'RETRY~%") (throw 'ok (funcall thunk))) (format t "LOOP~%")))))
(defmacro with-retry-restart ((&key (msg "Retry.")) &body body) (check-type msg string) `(call-with-retry-restart ,msg #'(lambda () ,@body)))
(with-retry-restart () (format t "BODY~%") (unless (equal (read) "OUTTA") (error "Lost in a maze!")))
After having invoked the retry restart, the new computation is aborted by the call to READ. I tried to get at what's causing this, but ran out of time. Perhaps you're luckier. Thanks in advance.
-T.
* Tobias C. Rittweiler [2008-01-18 19:43+0100] writes:
After having invoked the retry restart, the new computation is aborted by the call to READ. I tried to get at what's causing this, but ran out of time. Perhaps you're luckier. Thanks in advance.
It's probably caused by the: (add-local-hook 'kill-buffer-hook 'sldb-quit) After invoking the restart sldb reaches debug level 0 and kills the buffer. Funny that this wasn't uncovered by the tests.
Helmut.
On 1/19/08, Helmut Eller heller@common-lisp.net wrote:
- Tobias C. Rittweiler [2008-01-18 19:43+0100] writes:
After having invoked the retry restart, the new computation is aborted by the call to READ. I tried to get at what's causing this, but ran out of time. Perhaps you're luckier. Thanks in advance.
It's probably caused by the: (add-local-hook 'kill-buffer-hook 'sldb-quit) After invoking the restart sldb reaches debug level 0 and kills the buffer. Funny that this wasn't uncovered by the tests.
I can confirm this. It makes interactive restarts in the debugger pretty useless. and removing that hook restores workingness.
Cheers,
-- Nikodemus