unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Keith Wright <kwright@keithdiane.us>
To: wingo@pobox.com
Cc: guile-user@gnu.org
Subject: Re: manipulating continuations
Date: Sat, 12 Feb 2011 11:40:07 -0500	[thread overview]
Message-ID: <201102121640.p1CGe7PM003227@fcs13.keithdiane.us> (raw)
In-Reply-To: <m3oc6h9s1s.fsf@unquote.localdomain> (message from Andy Wingo on Sat, 12 Feb 2011 16:43:59 +0100)

> From: Andy Wingo <wingo@pobox.com>
> 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



  reply	other threads:[~2011-02-12 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12 14:10 manipulating continuations Thomas Girod
2011-02-12 15:43 ` Andy Wingo
2011-02-12 16:40   ` Keith Wright [this message]
2011-02-12 17:16     ` Andy Wingo
2011-02-12 20:56       ` Thien-Thi Nguyen
2011-02-12 21:33         ` Andy Wingo
     [not found]   ` <1297887196-sup-8146@cresylol.hd.free.fr>
2011-02-17 11:08     ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2011-02-12  8:35 Tomtom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102121640.p1CGe7PM003227@fcs13.keithdiane.us \
    --to=kwright@keithdiane.us \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).