Skip to content

Commit

Permalink
Added R:It.AllButFirst
Browse files Browse the repository at this point in the history
Returns an iterator that produces all but the first value
  • Loading branch information
lizmat committed Apr 1, 2020
1 parent 88a9a36 commit 4fe18a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core.c/Rakudo/Iterator.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ class Rakudo::Iterator {
#-------------------------------------------------------------------------------
# Methods that generate an Iterator (in alphabetical order)

# Return iterator that produces all but the first value
method AllButFirst(\iterator) { iterator.skip-one; iterator }

# Create iterator that produces all values *except* the last of a given
# iterator. Returns an empty iterator if the given iterator did not
# produce any value
Expand Down

0 comments on commit 4fe18a4

Please sign in to comment.