No. Here are some things you can do with real continuation support that you can't do with generators in Python:
Pass a continuation to a subroutine, which then invokes it. (You can pass a generator to a subroutine, but the generator can't pass its ability to yield a value to its caller to a subroutine.)
Return from the same function call more than once.
Unwind the stack when, say, you have an error or a recursive search finds what it was looking for.
The surprising thing is that it turns out to be possible to implement such a general construct efficiently.
(no subject)
Date: 2009-05-29 06:51 am (UTC)The surprising thing is that it turns out to be possible to implement such a general construct efficiently.