guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-stack-copying call-with-current-continuation?


From: David Kastrup
Subject: Re: Non-stack-copying call-with-current-continuation?
Date: Sun, 04 Mar 2012 14:59:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Andy Wingo <address@hidden> writes:

> Hi David,
>
> On Sun 04 Mar 2012 13:01, David Kastrup <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]