From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang J Moeller Newsgroups: gmane.lisp.guile.bugs Subject: Re: shift and reset in ice-9 control Date: Mon, 21 Mar 2011 02:31:01 +0100 (CET) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: dough.gmane.org 1300671099 15664 80.91.229.12 (21 Mar 2011 01:31:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2011 01:31:39 +0000 (UTC) Cc: bug-guile@gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Mar 21 02:31:29 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1Txw-00043g-JY for guile-bugs@m.gmane.org; Mon, 21 Mar 2011 02:31:28 +0100 Original-Received: from localhost ([127.0.0.1]:42244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1Txw-0001Ar-0B for guile-bugs@m.gmane.org; Sun, 20 Mar 2011 21:31:28 -0400 Original-Received: from [140.186.70.92] (port=52627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1Txo-00013N-Vh for bug-guile@gnu.org; Sun, 20 Mar 2011 21:31:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1Txo-0000ol-0m for bug-guile@gnu.org; Sun, 20 Mar 2011 21:31:20 -0400 Original-Received: from mailer.gwdg.de ([134.76.10.26]:52201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1Txn-0000og-Pj for bug-guile@gnu.org; Sun, 20 Mar 2011 21:31:19 -0400 Original-Received: from gwdw03.gwdg.de ([134.76.5.10]) by mailer.gwdg.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Q1Txl-0003CG-Hi; Mon, 21 Mar 2011 02:31:17 +0100 In-Reply-To: X-Virus-Scanned: (clean) by exiscan+sophie X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 134.76.10.26 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5355 Archived-At: Hello again, On Thu, 17 Mar 2011, Andy Wingo wrote: >[...] > On Wed 09 Mar 2011 11:53, Wolfgang J Moeller writes: >[...] > > (define-syntax reset > > (syntax-rules () > > ((_ . body) > > (call-with-prompt 'Reset > > (lambda () . body) > > (lambda (cont f) (f cont)))))) > > ;; > > (define-syntax shift > > (syntax-rules () > > ((_ var . body) > > (abort-to-prompt 'Reset > > (lambda (cont) > > ((lambda (var) (reset . body)) > > (lambda vals (reset (apply cont vals))))))))) >[...] > Did you write these yourself? May we include them in (ice-9 control)? Yes and yes. However, I don't like it anymore, since I seem to have learned that this "direct implementation" doesn't at all play well with the use of call/cc within the s, while the call/cc-based implementations of shift/reset appear to do so. I've yet to find out why the latter work "better", and if there's a remedy possible using something like with-continuation-barrier ... > If you have additional useful tests, we are happy to include them as > well. Probably the easiest thing would be to mail them to the list with > a permissive copyright header. The tests that I had included come from http://okmij.org/ftp/, as does almost all I know about "delimited continations" (I first learned about them only a few weeks before you released GUILE V2). There are a few more tests at that site. Best regards, Wolfgang J. Moeller, Tel. +49 551 47361, wjmheenes.com 37085 Goettingen, Germany | Disclaimer: No claim intended! http://www.wjmoeller.de/ -+-------- http://www.heenes.com/