I have zero mileage with Python generators and I don't teach CS. But
my understanding is:

Sometimes you have a problem where it is nicer to express the solution
as two independent pieces: a producer and a consumer that run
concurrently.

("Concurrently" doesn't necessarily mean actually in parallel, as with
an OS thread or process. In fact it's often simpler if it _doesn't_
mean that.)

In Racket you might run the producer and consumer in different threads
that talk over a channel. The producer does `channel-put` instead of
`yield`, and the consumer does `channel-get` or `sync`.

If you squint, it's all variations or specializations of continuations:

http://matt.might.net/articles/programming-with-continuations--exceptions-backtracking-search-threads-generators-coroutines/

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to