[Python-Dev] 'stackless' python?

Tim Peters tim_one at email.msn.com
Wed May 19 07:41:39 CEST 1999


[Sam]
> ...
> Except that since the escape procedure is 'first-class' it can be
> stored away and invoked (and reinvoked) later.  [that's all that
> 'first-class' means: a thing that can be stored in a variable,
> returned from a function, used as an argument, etc..]
>
> I've never seen a let/cc that wasn't full-blown, but it wouldn't
> surprise me.

The let/cc's in question were specifically defined to create continuations
valid only during let/cc's dynamic extent, so that, sure, you could store
them away, but trying to invoke one later could be an error.  It's in that
sense I meant they weren't "first class".

Other flavors of Scheme appear to call this concept "weak continuation", and
use a different verb to invoke it (like call-with-escaping-continuation, or
call/ec).  Suspect the let/cc oddballs I found were simply confused
implementations (there are a lot of amateur Scheme implementations out
there!).

>> Would full-blown coroutines be powerful enough for your needs?

> Yes, I think they would be.  But I think with Python it's going to
> be just about as hard, either way.

Most people on this list are comfortable with coroutines already because
they already understand them -- Jeremy can even reach across the hall and
hand Guido a helpful book <wink>.  So pondering coroutines increase the
number of brain cells willing to think about the implementation.

continuation-examples-leave-people-still-going-"huh?"-after-an-
    hour-of-explanation-ly y'rs  - tim






More information about the Python-Dev mailing list