From: Wolfgang J Moeller <wjm@heenes.com>
To: Andy Wingo <wingo@pobox.com>
Cc: bug-guile@gnu.org
Subject: Re: shift and reset in ice-9 control
Date: Mon, 21 Mar 2011 02:31:01 +0100 (CET) [thread overview]
Message-ID: <alpine.LNX.2.00.1103210208400.31502@gwdw03.gwdg.de> (raw)
In-Reply-To: <m362ri10ic.fsf@unquote.localdomain>
Hello again,
On Thu, 17 Mar 2011, Andy Wingo wrote:
>[...]
> On Wed 09 Mar 2011 11:53, Wolfgang J Moeller <wjm@heenes.com> 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 <body>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, wjm<AT>heenes.com
37085 Goettingen, Germany | Disclaimer: No claim intended!
http://www.wjmoeller.de/ -+-------- http://www.heenes.com/
next prev parent reply other threads:[~2011-03-21 1:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 10:53 guile 2.0.0 crash related to call-with-prompt/abort-to-prompt, & more Wolfgang J Moeller
2011-03-11 20:02 ` Andy Wingo
2011-03-14 20:51 ` Andy Wingo
2011-03-14 22:00 ` Andy Wingo
2011-03-15 22:56 ` Andy Wingo
2011-03-17 10:53 ` shift and reset in ice-9 control Andy Wingo
2011-03-21 1:31 ` Wolfgang J Moeller [this message]
2011-03-30 14:56 ` Andy Wingo
2011-04-02 14:40 ` Wolfgang J Moeller
2011-04-12 9:51 ` Andy Wingo
2011-04-12 13:11 ` Wolfgang J Moeller
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=alpine.LNX.2.00.1103210208400.31502@gwdw03.gwdg.de \
--to=wjm@heenes.com \
--cc=bug-guile@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).