guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lazy catch behaviour


From: Marius Vollmer
Subject: Re: Lazy catch behaviour
Date: 15 May 2001 02:29:01 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Neil Jerram <address@hidden> writes:

> (It reminds me of some proprietary code that I worked on, where
> asserts were encouraged, but you sort of had to cope with the
> asserts being compiled out as well, since some customers did that!)

(That's a valid way to use asserts, I'd say!)

> AFAICT, we mainly use lazy-catch in Guile to implement stack saving
> (for backtraces).  I think we could achieve this in a better way by
> defining a procedure-based protocol for errors.  For example, we could
> do something like:
> 
> - Make sure that all libguile errors and Scheme-level errors signalled
>   by calling `(error ...)' come through a single place, say
>   `error-junction'.
> 
> - Have `error-junction' call `current-error-handler'.
> 
> - Define `default-error-handler', which handles the error by throwing.
> 
> - (define current-error-handler default-error-handler).
> 
> Then we (both users and Guile central) can do stack saving and other
> things by redefining current-error-handler, and we don't need
> lazy-catch anymore.
> 
> What do you think?

Yes, sounds reasonable.  If this will rid us of `lazy-catch', that
would maybe be reason enough to implement it.  Mikael knows more about
`lazy-catch'.

However, I'd also like to discuss this in a broader context, some day,
including the debugger, etc.  You might want to re-read the thread
"Procedure proposal: call-with-escape-procedure" for more thoughts in
this genral direction, but not much about how to invoke the debugger.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]