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.