From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith Wright Newsgroups: gmane.lisp.guile.user Subject: Re: manipulating continuations Date: Sat, 12 Feb 2011 11:40:07 -0500 Message-ID: <201102121640.p1CGe7PM003227@fcs13.keithdiane.us> References: <4D5694ED.7080402@gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1297528748 17307 80.91.229.12 (12 Feb 2011 16:39:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 16:39:08 +0000 (UTC) Cc: guile-user@gnu.org To: wingo@pobox.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Feb 12 17:39:04 2011 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.69) (envelope-from ) id 1PoIUw-0005Sg-Bk for guile-user@m.gmane.org; Sat, 12 Feb 2011 17:39:02 +0100 Original-Received: from localhost ([127.0.0.1]:47320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoIUv-0006M0-TI for guile-user@m.gmane.org; Sat, 12 Feb 2011 11:39:01 -0500 Original-Received: from [140.186.70.92] (port=40364 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoIUs-0006Lu-I8 for guile-user@gnu.org; Sat, 12 Feb 2011 11:38:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoIUr-0001pt-Ce for guile-user@gnu.org; Sat, 12 Feb 2011 11:38:58 -0500 Original-Received: from mail2.sea5.speakeasy.net ([69.17.117.41]:59677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoIUr-0001nT-1h for guile-user@gnu.org; Sat, 12 Feb 2011 11:38:57 -0500 Original-Received: (qmail 12538 invoked from network); 12 Feb 2011 16:38:45 -0000 Original-Received: from dsl.keithdiane.us (HELO fcs12.keithdiane.us) ([66.92.74.188]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 Feb 2011 16:38:44 -0000 Original-Received: from fcs13.keithdiane.us (fcs13 [192.168.1.112]) by fcs12.keithdiane.us (Postfix) with ESMTP id 08EF0237846; Sat, 12 Feb 2011 11:39:12 -0500 (EST) Original-Received: from fcs13.keithdiane.us (localhost.localdomain [127.0.0.1]) by fcs13.keithdiane.us (Postfix) with ESMTP id CCB69AF4043; Sat, 12 Feb 2011 11:40:19 -0500 (EST) Original-Received: (from kwright@localhost) by fcs13.keithdiane.us (8.13.1/8.13.1/Submit) id p1CGe7PM003227; Sat, 12 Feb 2011 11:40:07 -0500 X-Authentication-Warning: fcs13.keithdiane.us: kwright set sender to kwright@keithdiane.us using -f In-reply-to: (message from Andy Wingo on Sat, 12 Feb 2011 16:43:59 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 69.17.117.41 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:8429 Archived-At: > From: Andy Wingo > Cc: guile-user@gnu.org > > Hi Thomas, > > In this expression, `foo' has returned twice. The first time it > returned a continuation, which was applied. The second time it returned > whatever `newline' returned: the unspecified value. Applying the > unspecified value failed. This first part is good. It explains that you have evaluated ((newline)) on the second call. > If you use Guile 1.9/2.0, partial continuations behave more in the way > you were thinking of: > > (use-modules (ice-9 control)) > > (define (foo) > (% (begin > (display "first part\n") > (abort) > (display "second part\n")) > (lambda (cont) > ;; abort jumps back here, to the handler. return the partial > ;; continuation. > cont))) This is not Scheme and should be ignored by anyone who is new to Scheme. I have been using Scheme, off and on, for decades but I can't read this program. What is (% ...)? What is a "partial continuation"? Has Guile gone off into left field, never to return? Can we continue from R5RS or R6RS? -- Keith