Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.squish on a lazy iterable returns something lazy
  • Loading branch information
moritz committed Aug 26, 2015
1 parent c4a122b commit 0bfeaff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Any-iterable-methods.pm
Expand Up @@ -642,22 +642,24 @@ augment class Any {
multi method squish( :&as!, :&with = &[===] ) {
my $last = @secret;
my str $which;
gather self.map: {
my \res := gather self.map: {
$which = &as($_).Str;
unless with($which,$last) {
$last = $which;
take $_;
}
}
self.is-lazy ?? res.lazy !! res
}
multi method squish( :&with = &[===] ) {
my $last = @secret;
gather self.map: {
my \res := gather self.map: {
unless with($_,$last) {
$last = $_;
take $_;
}
}
self.is-lazy ?? res.lazy !! res
}

proto method pairup(|) is nodal { * }
Expand Down

0 comments on commit 0bfeaff

Please sign in to comment.