guile-user
[Top][All Lists]
Advanced

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

Re: using compensations stacks with Guile


From: Marco Maggi
Subject: Re: using compensations stacks with Guile
Date: Wed, 2 May 2007 21:15:25 +0200

"Alan Grover" wrote:
> I noticed "the compensation closures are wrapped in
> false-if-exception: this causes errors to be ignored
> and all the closures to be evaluated." Could you revise
> this to signal the exception? Silently consumption of
> an exception is very frustrating, and surprising.

I have not coded this with the specific purpose of
suppressing an exception: the purpose is to go on
evaluating the other compensation closures even when
one or more of them fail, that way the code tries to
free resources as much as possible.

If you have 5 resources, you free 2 successfully and the
third free function fails: what do you do? If you raise
an exception the last 2 resources will be leaked, unless
you adopt a (IMHO) really complex architecture of context
sharing in your program.

I find this discussion similar to the one related to
exception-raising object destructors in C++: if you throw
an exception, there is no way to go back later and
finish the destruction (a lot of papers/weblogs on the
web about this).

--
Marco Maggi






reply via email to

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