|Think about Loose Coupling|
Ruby's "yield" and "blocks" are not coroutinesby LanX (Canon)
|on Apr 23, 2013 at 14:51 UTC||Need Help??|
Sorry I'm tired of repeating it, but even if Rubyistas claim it, yield / blocks are not coroutines, they are syntactic sugar for callbacks.
And I think Matz is to blame for choosing the misleading term "yield" in this context.
(Like Larry is to blame for some misleading "List" <-> "Array" terminology)
And BTW Perl5 has coroutines, passing parameters is just ugly to implement and I'm not sure about the performance gain.
Go take a look at the goto &sub syntax.
( addicted to the Perl Programming Language)