Continuations and threads (was Re: Iterators & generators)

Neil Schemenauer nascheme at enme.ucalgary.ca
Thu Feb 17 17:52:01 EST 2000


Samuel A. Falvo II <kc5tja at garnet.armored.net> wrote:
>OK, that's informative.  So much for the differences between threads and
>continuations.  But I'm still left wondering just what the heck
>continuations are.  :)

Here is my two bit explaination (based on Scheme's call/cc):

A continuation is a function which represents the rest of the
program.  Instead of returning from a function you can call this
function giving it one argument which is the return value.

These functions are first class just like everything else in
Scheme.  You can bind them to variables or pass them as
arguments.  You can also call them more than once passing
different "return" values.

I hope that doesn't damage the old melon too much. :)


    Neil



More information about the Python-list mailing list