In role IteratorĀ§
See primary documentation in context for method sink-all
method sink-all(Iterator:D: --> IterationEnd)
Should exhaust the iterator purely for the side-effects of producing the values, without actually saving them in any way. Should always return IterationEnd
. If there are no side-effects associated with producing a value, then it can be implemented by a consuming class to be a virtual no-op.
say (1 .. 1000).iterator.sink-all; # OUTPUT: Ā«IterationEndā¤Ā»
The Iterator role implements this method as a loop that calls pull-one
until it is exhausted.