Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GLRify [>] (and in general, non-triangle METAOP_REDUCE_CHAIN)
  • Loading branch information
moritz committed Aug 20, 2015
1 parent 83a29ca commit 5e3cfb3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/core/metaops.pm
Expand Up @@ -254,12 +254,15 @@ multi sub METAOP_REDUCE_CHAIN(\op) {
my $ :=
#?endif
sub (*@values) {
my $state = True;
my Mu $current := @values.shift;
while @values.gimme(1) {
$state = op.($current, @values[0]);
$current := @values.shift;
my $state := True;
my \iter = @values.iterator;
my $current := iter.pull-one;
return True if $current =:= IterationEnd;

while (my $next := iter.pull-one) !=:= IterationEnd {
$state := op.($current, $next);
return $state unless $state;
$current := $next;
}
$state;
}
Expand Down

0 comments on commit 5e3cfb3

Please sign in to comment.