GNU bug report logs - #21894
escape continuation doc wrong about reinvokability

Previous Next

Package: guile;

Reported by: Zefram <zefram <at> fysh.org>

Date: Thu, 12 Nov 2015 23:28:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Andy Wingo <wingo <at> pobox.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#21894: closed (escape continuation doc wrong about
 reinvokability)
Date: Fri, 24 Jun 2016 16:22:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 24 Jun 2016 18:20:59 +0200
with message-id <87a8iaeexg.fsf <at> pobox.com>
and subject line Re: bug#21894: escape continuation doc wrong about reinvokability
has caused the debbugs.gnu.org bug report #21894,
regarding escape continuation doc wrong about reinvokability
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
21894: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21894
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Zefram <zefram <at> fysh.org>
To: bug-guile <at> gnu.org
Subject: escape continuation doc wrong about reinvokability
Date: Thu, 12 Nov 2015 23:27:42 +0000
The manual says

#                  Escape continuations are delimited continuations whose
# only use is to make a non-local exit--i.e., to escape from the current
# continuation.  Such continuations are invoked only once, and for this
# reason they are sometimes called "one-shot continuations".

O RLY?

scheme@(guile-user)> (use-modules (ice-9 control))
scheme@(guile-user)> (define cc #f)
scheme@(guile-user)> (list 'a (let/ec e (list 'b (e (call-with-current-continuation (lambda (c) (set! cc c) 0))))))
$1 = (a 0)
scheme@(guile-user)> (cc 1)
$2 = (a 1)
scheme@(guile-user)> (cc 2)
$3 = (a 2)

Clearly I have invoked this escape continuation, successfully, more
than once.  The semantics here are perfectly sensible, it's just
the documentation that's off the mark, because it ignores how escape
continuations interact with other kinds of continuation.  I suggest
changing "Such continuations are invoked only once" sentence to something
like

    Such continuations can only be invoked from within the dynamic
    extent of the call to which they will jump.  Because the jump
    ends that extent, if escape continuations are the only kind of
    continuations being used it is only possible to invoke an escape
    continuation at most once.  For this reason they are sometimes
    called "one-shot continuations", but that is a misnomer when other
    kinds of continuations are also in use.  Most kinds can reinstate a
    dynamic extent that has been exited, and if the extent of an escape
    continuation is reinstated then it can be invoked again to exit that
    extent again.  Conversely, an escape continuation cannot be invoked
    from a separate thread that has its own dynamic state not including
    the continuation's extent, even if the continuation's extent is
    still in progress in its original thread and the continuation has
    never been invoked.

-zefram


[Message part 3 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: Zefram <zefram <at> fysh.org>
Cc: 21894-done <at> debbugs.gnu.org
Subject: Re: bug#21894: escape continuation doc wrong about reinvokability
Date: Fri, 24 Jun 2016 18:20:59 +0200
On Fri 13 Nov 2015 00:27, Zefram <zefram <at> fysh.org> writes:

> #                  Escape continuations are delimited continuations whose
> # only use is to make a non-local exit--i.e., to escape from the current
> # continuation.  Such continuations are invoked only once, and for this
> # reason they are sometimes called "one-shot continuations".
>
> O RLY?

:)

I removed that last sentence.  By saying less it will be less possible
to enter into this kind of error :)

Thanks for the report,

Andy

BTW: You have submitted some really nice reports!  If you would like to
assign copyright to the FSF so that you can get patches into Guile, let
me know and I can send you the docs.  Cheers :)


This bug report was last modified 8 years and 332 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.