From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.user Subject: Re: `lazy-catch' and `dynamic-wind' Date: Sun, 23 Nov 2008 23:25:36 +0000 Message-ID: <49dd78620811231525h50cf6c7fs106ced6ac6518e03@mail.gmail.com> References: <87fxliicbt.fsf@gnu.org> <49dd78620811231334i1f348223o282423adc009493@mail.gmail.com> <87d4gm59w7.fsf@gnu.org> 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: ger.gmane.org 1227482751 28498 80.91.229.12 (23 Nov 2008 23:25:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2008 23:25:51 +0000 (UTC) Cc: guile-user@gnu.org To: "=?ISO-8859-1?Q?Ludovic_Court=E8s?=" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 24 00:26:54 2008 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 1L4OLu-00079o-LM for guile-user@m.gmane.org; Mon, 24 Nov 2008 00:26:54 +0100 Original-Received: from localhost ([127.0.0.1]:37655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4OKl-0001dD-1F for guile-user@m.gmane.org; Sun, 23 Nov 2008 18:25:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L4OKg-0001d6-S2 for guile-user@gnu.org; Sun, 23 Nov 2008 18:25:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L4OKg-0001ct-D0 for guile-user@gnu.org; Sun, 23 Nov 2008 18:25:38 -0500 Original-Received: from [199.232.76.173] (port=37941 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4OKg-0001cq-6e for guile-user@gnu.org; Sun, 23 Nov 2008 18:25:38 -0500 Original-Received: from rv-out-0708.google.com ([209.85.198.245]:18921) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L4OKf-0007zw-6q for guile-user@gnu.org; Sun, 23 Nov 2008 18:25:37 -0500 Original-Received: by rv-out-0708.google.com with SMTP id k29so1972598rvb.6 for ; Sun, 23 Nov 2008 15:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Hu4vJflp9/r45RiwAxOp9M6n9BrLi6uoKvZezQhB5C0=; b=FgEy95Nz8hD7HzCRl5YWjzsZsCnHvmYXB3yik3TylPoxbj6dZFqknA5ZJfyoIek7Uf PWGOuOjZsVPjahfHxCoeLpMk93DvFd/fbSmK2NUyU54eP13pG396BiJZ9fsZvnWxwNtN WXCiQUr38m90wNYSYi8t9n5bs9BebkAcwHey8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=knECvjALeBTWO7qcY6Wz9AOl2YOTslwy5Y05T6GftV8jfYYhcxCzfdhUW/EO/aS2al LCQueXeTDqBBVNtxBm7akjkDpGwuWgEVEhv1cNDP4Q/z7wKkqDpzQh/1CnKgaQwPWg10 RptNpa9VyHOSeQjuNdWz/sNglzcQWaPyVPXM4= Original-Received: by 10.141.136.4 with SMTP id o4mr1543479rvn.13.1227482736311; Sun, 23 Nov 2008 15:25:36 -0800 (PST) Original-Received: by 10.140.199.14 with HTTP; Sun, 23 Nov 2008 15:25:36 -0800 (PST) In-Reply-To: <87d4gm59w7.fsf@gnu.org> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:6972 Archived-At: 2008/11/23 Ludovic Court=E8s : > > Exactly, thanks! Now, I was actually using SRFI-34's > `with-exception-handler', which I expected to behave like > `with-throw-handler'. Should we change `with-exception-handler' to use > `with-throw-handler' instead of `lazy-catch'? Yes, I think we should, since SRFI-34 says that "The handler is called in the dynamic environment of the call to raise, except that the current exception handler is that in place for the call to with-exception-handler that installed the handler being called." (I recall now being aware of this as a discrepancy at the time I wrote (srfi srfi-34) using lazy-catch; but I let it slip because we didn't have with-throw-handler at that time, and because none of the SRFI-34 reference test cases at that time differentiated between unwinding or not unwinding the dynamic context, hence the lazy-catch implemented passed all of those cases.) Could you make that change? > (In fact, I don't understand when the `lazy-catch' semantics could be > preferable over the `with-throw-handler' semantics'.) I agree. To be fair, there is a slight messiness in the with-throw-handler semantics, because of the handler context being unwound before the handler is called, but there is a lot more messiness in the lazy-catch semantics. Regards, Neil