skip-at-least-pull-one
ErrorsCollection

skip-at-least-pull-one

Synthesised documentation from type/Iterator

From type/Iterator

See Original text in context

method skip-at-least-pull-one(Iterator:D: $targetint $to-skip --> Mu)

Should skip producing $to-skip values and if the iterator is still not exhausted, produce and return the next value. Should return IterationEnd if the iterator got exhausted at any point:

my $i = <a b c>.iterator;
say $i.skip-at-least-pull-one(2);
say $i.skip-at-least-pull-one(20=:= IterationEnd;
# OUTPUT: «c␤True␤»

The Iterator role implements this method as calling skip-at-least and then calling pull-one if it was not exhausted yet.