Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
change list associative reductions to onearg
  • Loading branch information
TimToady committed Sep 19, 2015
1 parent ea2d21c commit 9856a43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions src/core/metaops.pm
Expand Up @@ -189,21 +189,21 @@ multi sub METAOP_REDUCE_LIST(\op, \triangle) {
#?if jvm
my $ :=
#?endif
sub (*@values) {
sub (+values) {
GATHER({
my @list;
for @values -> \v {
for values -> \v {
@list.push(v);
take op.(|@list);
}
}).lazy-if(@values.is-lazy);
}).lazy-if(values.is-lazy);
}
}
multi sub METAOP_REDUCE_LIST(\op) {
#?if jvm
my $ :=
#?endif
sub (*@values) { op.(|@values) }
sub (+values) { op.(|values) }
}

proto sub METAOP_REDUCE_LISTINFIX(|) { * }
Expand All @@ -230,11 +230,8 @@ multi sub METAOP_REDUCE_LISTINFIX(\op) {
#?if jvm
my $ :=
#?endif
sub (|values) {
my \p = values[0];
nqp::iscont(p[0])
?? op.(|p.map({nqp::decont($_).list}))
!! op.(|p);
sub (+values) {
op.(|values.map({nqp::decont($_)}));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/operators.pm
Expand Up @@ -223,7 +223,7 @@ sub SEQUENCE(\left, Mu \right, :$exclude_end) {
for flat @a Z @e -> $from, $to {
@ranges.push: $($from ... $to);
}
.take for flat [X~] |@ranges;
.take for flat [X~] @ranges;
$stop = 1;
}
elsif $a lt $endpoint {
Expand Down

0 comments on commit 9856a43

Please sign in to comment.