[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to transparently re-throw?
From: |
Mikael Djurfeldt |
Subject: |
Re: Is there a way to transparently re-throw? |
Date: |
03 Mar 2001 20:49:28 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Dirk Herrmann <address@hidden> writes:
> It is still interesting to know how one could implement a 'rethrow'
> function.
There's no need to implement a special rethrow function. The key is
rather that a `catch' pops the stack before invoking the handler, thus
removing all information about the error.
I've now added a new module (ice-9 stack-catch) to the CVS guile which
you can use for rethrowing of errors:
(define (foo)
(stack-catch #t
(lambda () (koko))
(lambda args
(apply throw args))))
(foo)
<unnamed port>:3:19: In expression (koko):
<unnamed port>:3:19: Unbound variable: koko
ABORT: (unbound-variable)
Best,
/mdj