Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by LanX (Saint)
on Apr 22, 2013 at 23:35 UTC ( [id://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)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found