Re: Pipeline Performance

2004-09-21 Thread Michele Dondi
On Sat, 18 Sep 2004, Rod Adams wrote: 2. Should a subsequent implicit return behave differently than usual if some values have already been emitted? It seems clear to me that behind the scenes there should be a "stack" into which Cted stuff is pushed and that this is returned upon either explici

Re: Pipeline Performance

2004-09-21 Thread Michele Dondi
On Sat, 18 Sep 2004, Luke Palmer wrote: Example above becomes: sub MediansBy5 ([EMAIL PROTECTED]) { while @list.length >= 5 { emit (sort @list.splice(0,5))[2]; }} That's actually a very good idea. That's why Perl 6 has it :-) sub MediansBy5 ([EMAIL PROTECTED]) { gather {

Re: Pipeline Performance

2004-09-19 Thread Jonadab the Unsightly One
Luke Palmer <[EMAIL PROTECTED]> writes: > That's actually a very good idea. That's why Perl 6 has it :-) > > sub MediansBy5 ([EMAIL PROTECTED]) { > gather { > while @list >= 5 { # there's no .length; it's .elems > take (sort @list.splice(0,5))[2]; > }

Re: Pipeline Performance

2004-09-18 Thread Luke Palmer
Rod Adams writes: > Better documentation on gather/take is merited. Without a doubt. > I would question the need for C, however. Could not a lone > C/C force the return value of the enclosing routine/closure > to be a lazy list, and here's a few values to get things started? C is necessary. C

Re: Pipeline Performance

2004-09-18 Thread Rod Adams
Luke Palmer wrote: Jonadab the Unsightly One writes: Rod Adams <[EMAIL PROTECTED]> writes: One solution I see to this would be to have a "lazy return" of some kind, where you can send out what results you have so far, but not commit that your execution is over and still allow further result

Re: Pipeline Performance

2004-09-18 Thread Luke Palmer
Jonadab the Unsightly One writes: > Rod Adams <[EMAIL PROTECTED]> writes: > > > One solution I see to this would be to have a "lazy return" of some > > kind, where you can send out what results you have so far, but not > > commit that your execution is over and still allow further results to > > b

Re: Pipeline Performance

2004-09-18 Thread Jonadab the Unsightly One
Rod Adams <[EMAIL PROTECTED]> writes: > One solution I see to this would be to have a "lazy return" of some > kind, where you can send out what results you have so far, but not > commit that your execution is over and still allow further results to > be posted. For lack of better word coming to mi

Re: Pipeline Performance

2004-09-01 Thread Aaron Sherman
On Tue, 2004-08-31 at 14:11, Sean O'Rourke wrote: > At Tue, 31 Aug 2004 13:23:04 -0400, > [EMAIL PROTECTED] (Aaron Sherman) wrote: > > I would think you actually want to be able to define grep, map, et al. > > in terms of the mechanism for unraveling, and just let the optimizer > > collapse the ent

Re: Pipeline Performance

2004-09-01 Thread Sean O'Rourke
At Tue, 31 Aug 2004 13:23:04 -0400, [EMAIL PROTECTED] (Aaron Sherman) wrote: > I would think you actually want to be able to define grep, map, et al. > in terms of the mechanism for unraveling, and just let the optimizer > collapse the entire pipeline down to a single map. Even for map and grep th

Re: Pipeline Performance

2004-08-31 Thread Rod Adams
Aaron Sherman wrote: On Mon, 2004-08-30 at 16:34, Rod Adams wrote: @x = @y ==> map lc ==> grep length == 4; I would think you actually want to be able to define grep, map, et al. in terms of the mechanism for unraveling, and just let the optimizer collapse the entire pipeline down to a sing

Re: Pipeline Performance

2004-08-31 Thread Sean O'Rourke
At Tue, 31 Aug 2004 13:23:04 -0400, [EMAIL PROTECTED] (Aaron Sherman) wrote: > I would think you actually want to be able to define grep, map, et al. > in terms of the mechanism for unraveling, and just let the optimizer > collapse the entire pipeline down to a single map. Even for map and grep th

Re: Pipeline Performance

2004-08-31 Thread Aaron Sherman
On Mon, 2004-08-30 at 16:34, Rod Adams wrote: > @x = @y ==> map lc ==> grep length == 4; I would think you actually want to be able to define grep, map, et al. in terms of the mechanism for unraveling, and just let the optimizer collapse the entire pipeline down to a single map. To propose one w

Re: Pipeline Performance

2004-08-30 Thread Larry Wall
On Mon, Aug 30, 2004 at 03:34:20PM -0500, Rod Adams wrote: : My question is, is there anything that can be done within Perl 6 to help : alleviate this issue. All lists function lazily if they can in Perl 6. Larry

Pipeline Performance

2004-08-30 Thread Rod Adams
;d want to be able to construct my own map like functions, and have creating them with pipeline performance in mind to be easy. Just a thought, since with the creation of ==> and <==, pipelining is bound to become an even more common construct. -- Rod Adams Randy Sims's test case: