method pull-one

Documentation for method pull-one, assembled from the following types:

role Iterator

From Iterator

(Iterator) method pull-one

Defined as:

method pull-one(Iterator:D: --> Mu)

This method stub ensures that classes implementing the Iterator role provide a method named pull-one.

The pull-one method is supposed to return the next value if available, or the sentinel value IterationEnd if no more elements are available.

my $i = (1 .. 3).iterator;
say $i.pull-one;       # OUTPUT: «1␤» 
say $i.pull-one;       # OUTPUT: «2␤» 
say $i.pull-one;       # OUTPUT: «3␤» 
say $i.pull-one.perl;  # OUTPUT: «IterationEnd␤»