Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
That coroutine RFC seems rather sketchy. First of all, it's describing generators, not coroutines. Coroutines are symmetrical; a callee and caller are equal partners in saving and resuming state (unlike the master-slave paradigm suggested by the RFC). My feeble understanding of coroutine implementation is that it is best to create a continuation primitive first, from which coroutines, "green" threads, generators, and exceptions can all be easily derived. This is, by the way, an area in which Python (Stackless), and of course Scheme, are both far ahead of Perl.

I also failed to understand the logic of the following example from the RFC:

... one could write: %newhash = map {yield transform_key($_); transform_val($_)} +%oldhash; This flattens the %oldhash to a sequence of key/value pairs
This does not make sense to me, since $_ is a localized stack-based variable, which should in principle be wrapped up in the saved local context/state. Thus calls to transform_val would be operating on keys, not values.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

In reply to Re: Perl 6 coroutines (RFC 31) by MeowChow
in thread Perl 6 coroutines (RFC 31) by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (2)
    As of 2020-10-26 00:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (249 votes). Check out past polls.

      Notices?