• continuations in ``the art of computer programming''

    From Anton Antimo@anton@safunu.org to comp.programming on Tue Sep 22 13:43:55 2026
    From Newsgroup: comp.programming

    Donald Knuth has been documenting and investigating programming
    techniques forever in his monumental set called ``The Art of Computer Programming''. I suppose he must have in his own terms what is now
    called continuations. In which part section of which book is the Scheme call/cc primitive studied?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.programming on Tue Sep 22 18:04:31 2026
    From Newsgroup: comp.programming

    Anton Antimo <anton@safunu.org> wrote or quoted:
    Donald Knuth has been documenting and investigating programming
    techniques forever in his monumental set called ``The Art of Computer >Programming''. I suppose he must have in his own terms what is now
    called continuations. In which part section of which book is the Scheme >call/cc primitive studied?

    Scheme's call/cc is a high-level language programming con-
    struct outside the scope of Knuth's assembly-based approach.
    However, coroutines are treated in Volume 1, section 1.4.2.

    "call/cc" could be treated in volume 7 "Compiler Techniques",
    but volume 7 is still decades away.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From usenet@usenet@stegropa.de (Stefan =?utf-8?Q?Gro=C3=9Fe?= Pawig) to comp.programming on Tue Sep 22 20:01:18 2026
    From Newsgroup: comp.programming

    Anton Antimo <anton@safunu.org> writes:
    Donald Knuth has been documenting and investigating programming
    techniques forever in his monumental set called ``The Art of Computer Programming''. I suppose he must have in his own terms what is now
    called continuations. In which part section of which book is the Scheme call/cc primitive studied?

    I think the closest would be volume 1, section 1.4.2 on coroutines.

    Regards,
    Stefan
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.programming on Tue Sep 22 21:07:53 2026
    From Newsgroup: comp.programming

    On Tue, 22 Sep 2026 20:01:18 +0200, Stefan Gro|fe Pawig wrote:

    Anton Antimo <anton@safunu.org> writes:

    In which part section of which book is the Scheme call/cc primitive
    studied?

    I think the closest would be volume 1, section 1.4.2 on coroutines.

    Note that (stackful) coroutines are just one of the higher-level
    constructs that can be implemented with a continuation primitive.

    Continuations are somewhat more general than that.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Anton Antimo@anton@safunu.org to comp.programming on Thu Sep 24 13:59:54 2026
    From Newsgroup: comp.programming

    usenet@stegropa.de (Stefan Gro|fe Pawig) writes:

    Anton Antimo <anton@safunu.org> writes:
    Donald Knuth has been documenting and investigating programming
    techniques forever in his monumental set called ``The Art of Computer
    Programming''. I suppose he must have in his own terms what is now
    called continuations. In which part section of which book is the Scheme
    call/cc primitive studied?

    I think the closest would be volume 1, section 1.4.2 on coroutines.

    Thank you and all other posters in this thread.

    So I think call/cc is essentially a jump over there, do something and
    take here an address for you to get back to what you were doing before.

    As usual, not much magic behinds the scenes, but surely the implications
    of a jump instruction as far fetching, of which call/cc is a great illustration.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.programming on Fri Sep 25 00:06:27 2026
    From Newsgroup: comp.programming

    On Thu, 24 Sep 2026 13:59:54 -0300, Anton Antimo wrote:

    So I think call/cc is essentially a jump over there, do something
    and take here an address for you to get back to what you were doing
    before.

    There doesnrCOt need to be a jump to begin with. You could just save the
    return point and continue execution normally. Think setjmp/longjmp in
    C -- thatrCOs a form of continuation, too.

    ItrCOs just that the Lisps usually implement it as rCLcall a function
    while passing it another function which, when called, jumps back to
    just after the point of the initial callrCY.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Anton Antimo@anton@safunu.org to comp.programming on Sun Sep 27 11:21:25 2026
    From Newsgroup: comp.programming

    Lawrence DrCOOliveiro <ldo@nz.invalid> writes:

    On Thu, 24 Sep 2026 13:59:54 -0300, Anton Antimo wrote:

    So I think call/cc is essentially a jump over there, do something
    and take here an address for you to get back to what you were doing
    before.

    There doesnrCOt need to be a jump to begin with. You could just save the return point and continue execution normally. Think setjmp/longjmp in
    C -- thatrCOs a form of continuation, too.

    That could be seen as a jump-to-right-over-here?
    --- Synchronet 3.22a-Linux NewsLink 1.2