From: Will Coleda <[EMAIL PROTECTED]>
   Date: Fri, 8 Dec 2006 19:58:25 -0500

   . . .

   I'm attempting to implement the 'Range' object (and other lazy lists)  
   for perl6, using a coroutine to generate the next value in the range.  
   At the moment, all instantiations of the range object share the  
   coroutine for generating their value.

   I don't have to use coroutines here, but if I can, I think it'll make  
   the implementation easier.

   --
   Will "Coke" Coleda
   [EMAIL PROTECTED]

At this point, I think your choices are:

   1.  Have a separate coroutine sub that the method clones and saves in
the object; or

   2.  Store the coroutine state explicitly in the object, and emulate
yielding in the method.

   The second choice ought to be simpler, especially if (as I'm
guessing) there is only one C<yield> and the surrounding control
structures are straightforward.  It also has the advantage of not
breaking if the Coroutine object API has to change when it eventually
gets fixed.

                                        -- Bob

Reply via email to