unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
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: Tue, 12 Apr 2011 15:11:03 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1104121411060.13176@gwdw03.gwdg.de> (raw)
In-Reply-To: <m3bp0bkdbr.fsf@unquote.localdomain>

On Tue, 12 Apr 2011, Andy Wingo wrote:

>[...]
> Have you tried this on Racket?  I would expect that it would do the
> right thing.  The difference, AFAIK, is that a prompt delimits full
> continuations there as well.  That's why they call them "composable"
> continuations instead of "delimited" continuations: because either kind
> can be delimited; the real question is what properties do they have.
>
> I think we're going to switch to do that in Guile 2.2 as well.

Careful! One might easily come up with a reason to use call/cc in order
to leave/reenter a "composable" continuation - after all, it's supposed
to behave just like another procedure, and for tasks like "backtracking",
you do want procedures e.g. to return multiple times.

It seemed to me that the original specification of shift/reset
didn't describe the consequences of transfer of control (via call/cc)
"across" reset - maybe because it wasn't targeted specifically at Scheme.
That's why I had doubts that my co-routine problem could be solved.
Now that it is, I've no more problems with the current implementation.

Anyway, inhibiting some uses of call/cc would be quite non-scheme-y ...

>[...]
> > Depending upon what I do with this snippet (auto-compile, load vs. include),
> > it sometimes gets accepted by GUILE V2.0.0:
> >
> > 		auto,include	auto,load	noauto,include	noauto,load
> > ---------------------------------------------------------------------------
> > @toplevel	Error		Error		Error		OK
> > surrounded by
> > BEGIN	Error		Error		Error		Error
> > EVAL-WHEN	OK		OK		OK		Error
>
> Indeed.  If you need to evaluate previous expressions in order to expand
> later ones, you need eval-when.  That goes for forms within your
> prelude, and for the "users" of your prelude; Guile doesn't know that
> when it sees a `(load "prelude.scm")' that prelude.scm will define
> syntax definitions, so it won't pull in those definitions at
> compile-time, without an eval-when wrapping the load...
>
> I don't understand the noauto,load case there though.  Were some of your
> files compiled and some not?  Hmm...

By "noauto,load" I meant (load "prelude.scm") into "guile --no-auto-compile",
with care taken (as in all of the above ",load" cases ;-) that _no_ compiled
[& cached] files were in place. It's exactly this column that's confusing me
(still with Guile V2.0.0).

Btw, meanwhile I've found that wrapping the second (macro-using) part
in another (eval ...) - thus terminating the top-level definition context -
works just fine w/o EVAL-WHEN, and so my "new" prelude now can be LOADed
into GUILE V2 independent of auto-compilation, as well as into GUILE V1, etc.


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/



      reply	other threads:[~2011-04-12 13:11 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
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 [this message]

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.1104121411060.13176@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).