Re: restart-case for specific error types

On Jul 22, 2:51 pm, Madhu <enom...@xxxxxxxx> wrote:
* Andrew Myers Wrote on Thu, 22 Jul 2010 11:00:54 -0700 (PDT):
| Thanks for the quick answer, I just installed SBCL on my work machine
| and it works there too.  Looks like a problem with Allegro CL and I
| have an email in to their support asking about it.  Thanks for the
| data point!  Andrew

The issue is not so clear, given your intent.

See the thread starting at

And my suggestion there

Thanks for the link Madhu, we had considered your suggestion of using
a global to get around this but didn't like it. My provided code is
may not be clear because my intent was simply to show that nil was
being passed in all the time. Here is some code that is a bit more
straightforward and demonstrates the problem:

(define-condition my-error (error)
((my-message :accessor my-message :initform "my thrown error.")))

(defun maybe-signal-my-error (x)
(if ( = x 1) (error 'my-error) (error "Normal error."))
(continue (c) :test (lambda (condition) (format t "Condition type
is:~a~%" (type-of condition))
(typep condition 'my-error))
(format t "Caught condition of type ~a~%" (type-of c)))))

If you call maybe-signal-my-error in Allegro CL you will _always_ see
"Condition type is:NULL", in SBCL you will see the appropriate "SIMPLE-
ERROR" or "MY-ERROR". The problem doesn't really have anything to do
with which restarts are invoked/available. I would be happy if the
restarts were not presented at the REPL when the error was not of type