Stackless Python and Python 2.x
Tim Peters
tim.one at home.com
Sun Sep 2 15:44:41 EDT 2001
[Tim]
> and chapter 2 shows in excruciatingly detail how to implement
> CLU iterators>(also semi-coroutines) using almost-standard C, abusing
> the C stack via setjmp/longjmp tricks.
[Courageous]
> Sure; however, if you proposed something like this in either the C or
> C++ newsgroups, you'd get your heard torn off. It's simply not portable.
Didn't "almost-standard" and "abusing" imply "but not standard" to you? If
so, doesn't "but not standard" imply "not portable" too? Does to me.
> The standard doesn't require that you be allowed to jump up the stack.
It doesn't matter. Paul asked how generators can be implemented short of
full-blown coroutines or continuations. The text I pointed him to showed
one way it can be done using a single stack. If he's willing to accept
continuations as an implementation technique, the ways in which the
referenced technique run afoul of standard C are trivial by comparison. C
isn't the point here; "single stack" is.
More information about the Python-list
mailing list