Documentation for method push-exactly

Documentation for method push-exactly, assembled from the following types:

role Iterator

From Iterator

(Iterator) method push-exactly

Defined as:

method push-exactly(Iterator:D: $targetint $count --> Mu)

Produces $count elements, and for each of them, calls $target.push($value).

If fewer than $count elements are available from the iterator, it returns the sentinel value IterationEnd. Otherwise it returns $count.

my @array;
say (1 .. Inf).iterator.push-exactly(@array3); # OUTPUT: «3␤» 
say @array# [1 2 3]