Continuations

Mike Meyer mwm at mired.org
Tue Jan 21 12:37:05 EST 2003


jbperez808 at yahoo.com (Jonathan P.) writes:

> Christian Tismer <tismer at tismer.com> wrote in message news:<mailman.1043070703.14456.python-list at python.org>...
> > > Every introduction to continuations I've found either describes it using 
> > > Scheme, which I haven't touched in a decade, and which I suspect most 
> > > people haven't worked with at all, or re-uses the above Python example 
> > > with little explanation.
> > 
> > In Scheme, it is easier to express, and you don't need
> > tricks like above.
> > While Python doesn't need continuations.
> > Stackless focuses on tasklets and channels, now.
> 
> I finally understood how continuations worked when I
> spent a couple of days working with some examples in 
> Scheme.  Nathaniel Gray's, "A Tutorial on Continuations" 
> does a great job of demystifying it.  Once I understood
> how they worked, I found it really wasn't as arcane
> as the impression I first got.  The closest analogy
> I could think is that of a bookmark (in execution).

If you're a C programmer, the setjmp/longjmp functions provide
continuation functionality. Well, sort of - real continuations are
valid after the function that created them returns.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list