@@ -374,17 +374,19 @@ Creates a "tail" supply with the same semantics as L<List.tail|/type/List#method
374
374
375
375
method first(Supply:D: :$end, |c)
376
376
377
- This method is a frontend on the C < grep > method. Its creates a new "head"
378
- supply, or a "tail" supply if the optional named parameter C < :end >
379
- is truthy, from a supply created by calling the C < grep > method on the
380
- invocant, with any remaining arguments as parameters.
381
- If there are no remaining argument, this method is equivalent to calling
377
+ This method creates a supply of the first element, or the last element if
378
+ the optional named parameter C < :end > is truthy, from a supply created by
379
+ calling the C < grep > method on the invocant, with any remaining arguments
380
+ as parameters.
381
+ If there is no remaining argument, this method is equivalent to calling
382
382
on the invocant, without parameter, the C < head > or the C < tail > method,
383
383
according to named parameter C < :end > .
384
384
385
385
my $rand = supply { emit (rand × 100).floor for ^∞ };
386
386
my $first-prime = $rand.first: &is-prime;
387
- $first-prime.tap: &say; # output the first prime from the endless random number supply $rand
387
+ # output the first prime from the endless random number supply $rand,
388
+ # then the $first-prime supply reaches its end
389
+ $first-prime.tap: &say;
388
390
389
391
= head2 method rotor
390
392
0 commit comments