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

Ruby's "yield" and "blocks" are not coroutines

by LanX (Abbot)
on Apr 23, 2013 at 14:51 UTC ( #1030165=note: print w/ replies, xml ) Need Help??


in reply to Re: RFC: Simulating Ruby's "yield" and "blocks" in Perl
in thread RFC: Simulating Ruby's "yield" and "blocks" in Perl

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.

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Ruby's "yield" and "blocks" are not coroutines
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-04-21 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls