From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: Use of continuations in eval traps Date: Fri, 28 Oct 2005 22:54:08 +0200 Message-ID: <66e540fe0510281354m2eb93928p17aa82de7b1a4d5f@mail.gmail.com> References: <878xwdbhc9.fsf@ossau.uklinux.net> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1130532892 343 80.91.229.2 (28 Oct 2005 20:54:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Oct 2005 20:54:52 +0000 (UTC) Cc: Mikael Djurfeldt , Guile Development Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 28 22:54:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EVbEt-0004Tb-Ff for guile-devel@m.gmane.org; Fri, 28 Oct 2005 22:54:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVbEs-0006xN-UW for guile-devel@m.gmane.org; Fri, 28 Oct 2005 16:54:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EVbEp-0006x7-JL for guile-devel@gnu.org; Fri, 28 Oct 2005 16:54:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EVbEo-0006wE-8D for guile-devel@gnu.org; Fri, 28 Oct 2005 16:54:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVbEo-0006w8-41 for guile-devel@gnu.org; Fri, 28 Oct 2005 16:54:10 -0400 Original-Received: from [66.249.82.194] (helo=xproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EVbEo-0008NM-DP for guile-devel@gnu.org; Fri, 28 Oct 2005 16:54:10 -0400 Original-Received: by xproxy.gmail.com with SMTP id t4so392962wxc for ; Fri, 28 Oct 2005 13:54:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lnG9FDrIkZVpEMrFPrz2AZvZ+rgfyBNqnHayAC1MxbhB9dgh/bEqtCEMvGYUSK9+bqT9neQs5XHHc3pZ5hi+r3h4dDchVZ+tse7wV1KsWJ3gmlkbfmRAM0ZLvmNgi5DHNYocFVljaQuziBWfY+7K8ezKaLbov830vDrnCuL27mI= Original-Received: by 10.65.158.14 with SMTP id k14mr405022qbo; Fri, 28 Oct 2005 13:54:08 -0700 (PDT) Original-Received: by 10.65.98.1 with HTTP; Fri, 28 Oct 2005 13:54:08 -0700 (PDT) Original-To: Neil Jerram In-Reply-To: <878xwdbhc9.fsf@ossau.uklinux.net> Content-Disposition: inline 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:5362 Archived-At: On 10/28/05, Neil Jerram wrote: > I'm writing directly to you (CC guile-devel) because I believe you > originally implemented the low level traps in eval.c - please correct > me if that's wrong. No, that's right. > I'm thinking about how to implement the ability to skip over the > evaluation of an expression, and providing an easy interface for use > in my Emacs front end, and wondering whether the existing > continuation-based approach is really needed. The problem with the > continuation approach (in other words, whenever the 'cheaptraps option > is off) is that a continuation is set up before every trap call even > though it won't be needed in most cases, and it seems to me that one > could get similar function by passing the expression to evaluate into > the trap handler and allowing the trap handler to modify it (either by > side effect or by return, to be determined). > > If I'm right, it also follows that we could remove the 'cheaptraps > option and use debug-objects unconditionally for these trap calls. > Note that the trap handler remains free to save off its continuation > itself, if that is useful. > > What do you think? You are probably more competent to answer the question than me. I wrote that code when I was pretty inexperienced, and the choice to allow for the continuation to be saved was probably more motivated by a feeling that I didn't want any limitations on what you could do with traps than anything more specific---except that I probably had imagined the continuations as a way to resume execution after a breakpoint, of course. I agree that it seems expensive to create the continuation at every trap, and your idea to skip the cheaptraps option and delegate the decision whether to create the continuation or not to the lazy handler code (I assume) seems good. Unfortunately I can't say anything more constructive than that because I'm not up-to-date with the code. BTW, your work on the debugger and Emacs interface seems really great---tha= nks! M _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel