Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

by LanX (Sage)
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)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-08-17 20:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found