Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: RFC: Simulating Ruby's "yield" and "blocks" in Perl

by LanX (Canon)
on Apr 22, 2013 at 23:35 UTC ( #1030001=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

Thanks, looking into coro is on my todo list for .... ehm ... well ... some time now! =)

But do you agree that this is far from having any syntactic sugar? (rather "syntactic vinegar" ;-)

Just to avoid misunderstandings, Ruby's yield doesn't help creating coroutines!

The functions are executed in one run till the end and the yield are just executions of callbacks given by blocks.

Python OTOH uses yield a statement in so called "generators" to define iterators which freeze their state each time they return with yield.

Much like gather and take in Perl6.

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re^2: RFC: Simulating Ruby's "yield" and "blocks" in Perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-12-20 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls