Re: Returning to top-level on error



Christophe Rhodes <csr21@xxxxxxxxx> writes:

> "Steven M. Haflich" <smh@xxxxxxxxxxxx> writes:
>
> > I think Pascal's answer is correct and quite sufficient in normal
> > circumstances and in the way the condition system is normally used,
> > but it isn't bulletproof in the face of strangely written
> > application code.
>
> Isn't the way to disable the debugger, well, to disable the debugger,
> rather than to try to handle conditions of various types?
>
> (defun probably-disable-debugger (c f)
> (declare (ignore f))
> (abort c))
> (setf *debugger-hook* #'probably-disable-debugger)

That will work, except for explicit calls to CL:BREAK, and assuming
your implementation doesn't do something annoying, like have another
*debugger-hook*-alike. Man, that took me long enough to figure out.
So, add to that:

#+sbcl (setf sb-ext:*invoke-debugger-hook* #'probably-disable-debugger)

--
/|_ .-----------------------.
,' .\ / | Free Mumia Abu-Jamal! |
,--' _,' | Abolish the racist |
/ / | death penalty! |
( -. | `-----------------------'
| ) |
(`-. '--.)
`. )----'
.


Quantcast