From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marco Maggi" Newsgroups: gmane.lisp.guile.user Subject: Re: using compensations stacks with Guile Date: Wed, 2 May 2007 21:15:25 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1178133380 22341 80.91.229.12 (2 May 2007 19:16:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 May 2007 19:16:20 +0000 (UTC) To: "guile-user" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed May 02 21:16:18 2007 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HjKJF-0005tt-QI for guile-user@m.gmane.org; Wed, 02 May 2007 21:16:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HjKPg-0002pK-Mh for guile-user@m.gmane.org; Wed, 02 May 2007 15:22:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HjKOt-0002az-CM for guile-user@gnu.org; Wed, 02 May 2007 15:22:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HjKOs-0002a8-Py for guile-user@gnu.org; Wed, 02 May 2007 15:22:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HjKOs-0002a4-Fa for guile-user@gnu.org; Wed, 02 May 2007 15:22:06 -0400 Original-Received: from relay-pt3.poste.it ([62.241.4.129]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HjKIQ-0002eV-Et for guile-user@gnu.org; Wed, 02 May 2007 15:15:26 -0400 Original-Received: from poste.it (192.168.144.52) by relay-pt3.poste.it (7.2.063) (authenticated as marco.maggi-ipsu@poste.it) id 4637C6C00001289F for guile-user@gnu.org; Wed, 2 May 2007 21:15:25 +0200 X-Sensitivity: 3 X-XaM3-API-Version: 4.3 (R1) (B3pl19) X-SenderIP: 81.211.189.41 X-detected-kernel: Solaris 9 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5939 Archived-At: "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 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user