Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
reductions now one-arg
  • Loading branch information
TimToady committed Sep 19, 2015
1 parent 039de8f commit 83d7248
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/metaops.pm
Expand Up @@ -150,8 +150,8 @@ multi sub METAOP_REDUCE_RIGHT(\op, \triangle) {
#?if jvm
my $ :=
#?endif
sub (*@values) {
my \iter = @values.reverse.iterator;
sub (+values) {
my \iter = values.reverse.iterator;
my $result := iter.pull-one;
return () if $result =:= IterationEnd;

Expand All @@ -160,16 +160,16 @@ multi sub METAOP_REDUCE_RIGHT(\op, \triangle) {
while (my $elem := iter.pull-one) !=:= IterationEnd {
take $result := op.($elem, $result)
}
}.lazy-if(@values.is-lazy);
}.lazy-if(values.is-lazy);
}
}
multi sub METAOP_REDUCE_RIGHT(\op) {

#?if jvm
my $ :=
#?endif
sub (*@values) {
my \iter = @values.reverse.iterator;
sub (+values) {
my \iter = values.reverse.iterator;
my \first = iter.pull-one;
return op.() if first =:= IterationEnd;

Expand Down Expand Up @@ -240,9 +240,9 @@ multi sub METAOP_REDUCE_CHAIN(\op, \triangle) {
#?if jvm
my $ :=
#?endif
sub (*@values) {
sub (+values) {
my $state = True;
my \iter = @values.iterator;
my \iter = values.iterator;
my Mu $current = iter.pull-one;
gather {
take $state;
Expand All @@ -256,16 +256,16 @@ multi sub METAOP_REDUCE_CHAIN(\op, \triangle) {
take False;
}
}
}.lazy-if(@values.is-lazy);
}.lazy-if(values.is-lazy);
}
}
multi sub METAOP_REDUCE_CHAIN(\op) {
#?if jvm
my $ :=
#?endif
sub (*@values) {
sub (+values) {
my $state := True;
my \iter = @values.iterator;
my \iter = values.iterator;
my $current := iter.pull-one;
return True if $current =:= IterationEnd;

Expand Down

0 comments on commit 83d7248

Please sign in to comment.