From: David Kastrup <dak@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: Non-stack-copying call-with-current-continuation?
Date: Sun, 04 Mar 2012 14:59:12 +0100 [thread overview]
Message-ID: <87sjho5uxb.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87booca7er.fsf@pobox.com> (Andy Wingo's message of "Sun, 04 Mar 2012 13:15:56 +0100")
Andy Wingo <wingo@pobox.com> writes:
> Hi David,
>
> On Sun 04 Mar 2012 13:01, David Kastrup <dak@gnu.org> writes:
>
>> The global symbol space is a different identity space than heap
>> equality, and it never gets garbage collected: the lifetime of a
>> gensym is eternal.
>
> This is not true in Guile, where symbols can be garbage collected.
The symbol name is not garbage collected. That is the difference
between gensym and make-symbol.
>> And frankly: the manual talks about prompts being composable and
>> gives an example which seems utterly wrong to me since it does not
>> actually abort a computation but rather half-finishes it. It is
>> unclear what part of the computation will finish and what will
>> complete.
>
> That is an interesting point. I guess there are two ways of answering
> it. One is to note that in Scheme, it's difficult in general to
> determine whether a computation is finished or will finish, because of
> call/cc.
>
> But you ask about a specific point, here: an abort to a prompt is
> basically boils down to a longjmp to the prompt's handler. The
> partial continuation is logically passed as an argument to the
> handler.
But where does the "partial continuation" start and where does it end?
If I am doing a "longjmp to the prompt's handler", how can it be that
the calling stack frame inside of the thunk that is supposed to be
exited can finish a calculation? Where is the difference between
(+ 34 (abort-to-prompt 'foo))
and
(let ((x (abort-to-prompt 'foo))) (+ 34 x)) ?
Why is the first allowed to complete and return a result, and the second
(presumably) not? Or _if_ the second is allowed to complete, what does
"abort" in "abort-to-prompt" even mean?
All this does not really make discernible sense to me. Whereas call/ec
has rather clear semantics and usage. The one thing that is not
self-evident is its behavior in case of misuse, namely when it is asked
to do a job only call/cc can.
--
David Kastrup
next prev parent reply other threads:[~2012-03-04 13:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 0:00 Non-stack-copying call-with-current-continuation? David Kastrup
2012-03-02 0:20 ` Noah Lavine
2012-03-02 0:42 ` David Kastrup
2012-03-02 1:01 ` Noah Lavine
2012-03-02 1:35 ` David Kastrup
2012-03-02 1:49 ` Noah Lavine
2012-03-02 8:36 ` David Kastrup
2012-03-03 5:03 ` Andreas Rottmann
2012-03-03 5:04 ` Andreas Rottmann
2012-03-03 17:48 ` Andy Wingo
2012-03-04 12:01 ` David Kastrup
2012-03-04 12:15 ` Andy Wingo
2012-03-04 13:59 ` David Kastrup [this message]
2012-03-04 18:42 ` Andy Wingo
2012-03-04 18:45 ` Mark H Weaver
2012-03-04 23:13 ` David Kastrup
2012-03-05 0:35 ` Mark H Weaver
2012-03-05 1:44 ` David Kastrup
2012-03-02 1:18 ` Nala Ginrut
2012-03-02 1:25 ` Noah Lavine
2012-03-03 17:41 ` Andy Wingo
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=87sjho5uxb.fsf@fencepost.gnu.org \
--to=dak@gnu.org \
--cc=guile-devel@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).