From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Backtrace and enhanced catch Date: Mon, 16 Jan 2006 09:38:47 +0100 Organization: LAAS-CNRS Message-ID: <87hd84pnxk.fsf@laas.fr> References: <200511301616.22258.bkorb@gnu.org> <87wthpkyan.fsf@ossau.uklinux.net> <43B69F41.6030509@xs4all.nl> <87hd8pb8o7.fsf@ossau.uklinux.net> <87lkxy3abo.fsf@ossau.uklinux.net> <877j9i31gc.fsf@ossau.uklinux.net> <87acebhf1o.fsf@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137401951 24934 80.91.229.2 (16 Jan 2006 08:59:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2006 08:59:11 +0000 (UTC) Cc: hanwen@xs4all.nl, guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 16 09:59:02 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EyQCY-0006Rp-EB for guile-devel@m.gmane.org; Mon, 16 Jan 2006 09:58:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EyQEp-0007Hn-3D for guile-devel@m.gmane.org; Mon, 16 Jan 2006 04:01:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EyPwI-0002aC-C5 for guile-devel@gnu.org; Mon, 16 Jan 2006 03:42:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EyPwF-0002Zi-Fz for guile-devel@gnu.org; Mon, 16 Jan 2006 03:42:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EyPvP-0002RY-06 for guile-devel@gnu.org; Mon, 16 Jan 2006 03:41:16 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EyPys-0003UC-Ba for guile-devel@gnu.org; Mon, 16 Jan 2006 03:44:50 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id k0G8cmLc029152; Mon, 16 Jan 2006 09:38:49 +0100 (CET) Original-To: Neil Jerram X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 27 =?iso-8859-1?Q?Niv=F4se?= an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Neil Jerram , hanwen@xs4all.nl, guile-devel@gnu.org In-Reply-To: <87acebhf1o.fsf@ossau.uklinux.net> (Neil Jerram's message of "Wed, 04 Jan 2006 21:13:55 +0000") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5591 Archived-At: Hi, Better late than never... ;-) Neil Jerram 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. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel