Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re (tilly) 1: Perl 6 coroutines (RFC 31)

by tilly (Archbishop)
on Jul 14, 2001 at 22:41 UTC ( #96759=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6 coroutines (RFC 31)
in thread Perl 6 coroutines (RFC 31)

I think that Damian's proposal assumes that Perl is going to maintain a global stack, and what is saved is just the internal state of the function. Then $_, being a global, will be whatever it is currently in Perl while where you start in the block will be preserved.
  • Comment on Re (tilly) 1: Perl 6 coroutines (RFC 31)

Replies are listed 'Best First'.
Re: Re (tilly) 1: Perl 6 coroutines (RFC 31)
by MeowChow (Vicar) on Jul 15, 2001 at 02:15 UTC
    I believe that would create alot of nasty confusion, and make localized globals all but useless inside of coroutines. For instance, the following would be quite troublesome:
    sub my_iter { for (@_) { yield $_; # upon return, $_ may no longer be localized. if we # modify it, we could be modifying a global value # outside our scope. there's no way to tell, and # that's rather nasty. } }
    Of course, one could avoid using localized globals inside coroutines/generators in the first place, but where's the fun in that, I ask ;)
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-10-29 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (275 votes). Check out past polls.

    Notices?