Re: Coroutine Question

2005-05-04 Thread John Macdonald
On May 4, 2005 06:22 pm, Rod Adams wrote: > John Macdonald wrote: > > >On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: > > > > > >>If there are good uses for coroutines that given/take does not address, > >>I'll gladly change my opinion. But I'd like to see some examples. > >>FWIW, I

Re: Coroutine Question

2005-05-04 Thread Rod Adams
John Macdonald wrote: On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: If there are good uses for coroutines that given/take does not address, I'll gladly change my opinion. But I'd like to see some examples. FWIW, I believe that Patrick's example of the PGE returning matches could b

Re: Coroutine Question

2005-05-04 Thread Damian Conway
John Macdonald wrote a lovely summary of coroutines [omitted]. Then added: > I'd use "resume" instead of "coreturn" We've generally said we'd be using "yield". > and the interface for resume would allow values to be sent > in as well as out. Indeed. As John suggested, the "yield" keyword (or whatev

Re: Coroutine Question

2005-05-04 Thread John Macdonald
On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: > John Macdonald wrote: > > >The most common (and what people sometimes believe the > >*only* usage) is as a generator - a coroutime which creates a > >sequence of values as its "chunk" and always returns control > >to its caller. (This r

Re: Coroutine Question

2005-05-04 Thread Damian Conway
[Not back, just sufficiently irritated...] Luke Palmer wrote: in my proposal, when you call a coroutine, it returns an iterator (and doesn't call anything): my $example = example(); =$example; # 1 =$example; # 2 The thing this buys over the traditional (which I refer to as the "stupid

Re: Coroutine Question

2005-05-04 Thread Rod Adams
John Macdonald wrote: The most common (and what people sometimes believe the *only* usage) is as a generator - a coroutime which creates a sequence of values as its "chunk" and always returns control to its caller. (This retains part of the subordinate aspect of a subroutine. While it has the abi

Re: Coroutine Question

2005-05-04 Thread Patrick R. Michaud
On Wed, May 04, 2005 at 02:22:43PM -0400, John Macdonald wrote: > On Wed, May 04, 2005 at 10:43:22AM -0400, Aaron Sherman wrote: > > On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: > > > A coroutine is just a functional unit that can be re-started after a > > > previous return, so I would expect

Re: Coroutine Question

2005-05-04 Thread John Macdonald
On Wed, May 04, 2005 at 10:43:22AM -0400, Aaron Sherman wrote: > On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: > > On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: > > > > > So without asking for S17 in its entirety to be written, is it > > > possible to get a synopsis of how p6 will do coro

Re: Coroutine Question

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: > On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: > > > So without asking for S17 in its entirety to be written, is it > > possible to get a synopsis of how p6 will do coroutines? > > A coroutine is just a functional unit that can be re-started

Re: Coroutine Question

2005-05-04 Thread Joshua Gatcomb
On 5/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > On 5/4/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > > Ok - this isn't what I was expecting at all. That doesn't make it a > > bad thing. Given something that looks a lot more like a typical > > coroutine: > > > > sub example is coroutine { >

Re: Coroutine Question

2005-05-04 Thread Ingo Blechschmidt
Hi, Joshua Gatcomb wrote: > On 5/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote: >> On 5/4/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: >> > So without asking for S17 in its entirety to be written, is it >> > possible to get a synopsis of how p6 will do coroutines? I ask >> > because after reading

Coroutine Question

2005-05-04 Thread Luke Palmer
On 5/4/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > Ok - this isn't what I was expecting at all. That doesn't make it a > bad thing. Given something that looks a lot more like a typical > coroutine: > > sub example is coroutine { > yield 1; > yield 2; > yield 3; > } > > I would exp

Re: Coroutine Question

2005-05-04 Thread Joshua Gatcomb
On 5/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > On 5/4/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > > So without asking for S17 in its entirety to be written, is it > > possible to get a synopsis of how p6 will do coroutines? I ask > > because after reading Dan's "What the heck is: a corou

Re: Coroutine Question

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: > So without asking for S17 in its entirety to be written, is it > possible to get a synopsis of how p6 will do coroutines? A coroutine is just a functional unit that can be re-started after a previous return, so I would expect that in Perl, a co

Coroutine Question

2005-05-04 Thread Joshua Gatcomb
All, I am not the only one who has found porting p5 to working p6 code relatively easy and similar looking: http://perlmonks.org/index.pl?node_id=453821 In that thread, the author raised the question of coroutine support in Perl. I looked up coroutines in the "Perl6 Timeline By Apocalypse" threa