[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Backtrace and enhanced catch
From: |
Ludovic Courtès |
Subject: |
Re: Backtrace and enhanced catch |
Date: |
Mon, 16 Jan 2006 09:38:47 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
Better late than never... ;-)
Neil Jerram <address@hidden> writes:
> Another (lesser) problem with lazy-catch and with-exception-handler is
> that they are always used in practice in a particular pattern. For
> lazy-catch the pattern is
>
> (catch tag
> (lambda ()
> (lazy-catch tag thunk lazy-handler))
> catch-handler)
>
> For with-exception-handler the pattern (as shown by all the examples
> in SRFI-34) is
>
> (call/cc
> (lambda (k)
> (with-exception-handler
> (lambda (obj)
> ...
> (k 'exception))
> thunk)))
>
> Why is this a problem? Because it strongly suggests that these forms
> are more general than is useful. And there is a cost to this: a bit
> more typing in Scheme, and in the case of Guile a lot more complexity
> in the C code needed to set up a catch and lazy catch pair (which is
> relevant to the backtrace problem).
OTOH, this would suggest that `lazy-catch' and `call/cc' are all we need
to implement `catch'. This is probably the reason why SRFI-34 defines
no construct equivalent to `catch'.
>From a theoretical viewpoint, it seems to me that it would make sense to
just keep `lazy-catch' as a primitive and have `catch' implemented as a
macro on top of it. Now, from Guile's implementation viewpoint, I guess
it would be much more costly/complex as you said.
Anyway, thanks for your patch: it's nice to see this issue is going to
be fixed! ;-) And sorry for not replying earlier.
Ludovic.
- Re: No way out., Han-Wen Nienhuys, 2006/01/01
- Message not available
- Re: No way out., Han-Wen Nienhuys, 2006/01/01
- Re: No way out., Neil Jerram, 2006/01/02
- Re: No way out., Neil Jerram, 2006/01/02
- Backtrace and enhanced catch, Neil Jerram, 2006/01/04
- Re: Backtrace and enhanced catch, Neil Jerram, 2006/01/14
- Re: Backtrace and enhanced catch, Marius Vollmer, 2006/01/22
- Re: Backtrace and enhanced catch, Neil Jerram, 2006/01/23
- Re: Backtrace and enhanced catch, Marius Vollmer, 2006/01/24
- Re: Backtrace and enhanced catch,
Ludovic Courtès <=
- Re: Backtrace and enhanced catch, Neil Jerram, 2006/01/18
- Re: Backtrace and enhanced catch, Ludovic Courtès, 2006/01/19
- Re: Backtrace and enhanced catch, Neil Jerram, 2006/01/21
- Re: Backtrace and enhanced catch, Kevin Ryde, 2006/01/26
- Re: Backtrace and enhanced catch, Neil Jerram, 2006/01/27
- Re: Backtrace and enhanced catch, Kevin Ryde, 2006/01/31