Skip to content

Commit

Permalink
Implement Supply.first
Browse files Browse the repository at this point in the history
As a frontend of Supply.grep.
  • Loading branch information
lizmat committed Jan 18, 2020
1 parent 59f6a03 commit ace9853
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core.c/Supply-factories.pm6
Expand Up @@ -272,6 +272,12 @@
Supply.new(Grep.new(source => self.sanitize, :$test))
}

method first(Supply:D: :$end, |c) {
$end
?? self.grep(|c).tail
!! self.grep(|c).head
}

my class ScheduleOn does SimpleOpTappable {
has $!scheduler;

Expand Down

0 comments on commit ace9853

Please sign in to comment.