Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: (Semi-OT) Coroutine vs Continuation?

by Thelonius (Priest)
on Sep 13, 2004 at 14:24 UTC ( #390564=note: print w/ replies, xml ) Need Help??

in reply to (Semi-OT) Coroutine vs Continuation?

Here's a discussion about generators, coroutines, and continuations with respect to Python. Dan's code above would be called a generator in Python (and I think that's really the standard terminology).

Comment on Re: (Semi-OT) Coroutine vs Continuation?
Replies are listed 'Best First'.
Re^2: (Semi-OT) Coroutine vs Continuation?
by Elian (Parson) on Sep 13, 2004 at 15:43 UTC
    Both coroutine and generator are proper terminology. (They describe mostly the same thing, so I think generator was coined by someone unfamiliar with corotines) Generators are usually used only for simple things (iterators and such) and are normally very straightforward, and as such normally don't have a fully general coroutine implementation. Coroutines can be significantly more complex -- with proper back-end transformation you can implement a full pthreads-style threading system with coroutines, something you'd probably not want to do with generators.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://390564]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-29 22:56 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (269 votes), past polls