Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reinstate original grep handler for junctions
The new Seq based code for some reason does not handle grepping using with
a junction (at least according to test 28 in S32-list/grep.t).  Adding this
candidate using the original code, makes the test pass.  Not 100% if that
test is legit, though.  At least this reinstates the previous behaviour.
  • Loading branch information
lizmat committed Sep 23, 2015
1 parent 5a534d6 commit c3ba558
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Any-iterable-methods.pm
Expand Up @@ -356,6 +356,9 @@ augment class Any {
self.map(&tester);
}
}
multi method grep(Junction $test) is rw {
self.map({ next unless $_ ~~ $test; $_ });
}
multi method grep(Mu $test) is rw {
Seq.new(class :: does Grepper {
method pull-one() is rw {
Expand Down

0 comments on commit c3ba558

Please sign in to comment.