Skip to content

Commit e94d112

Browse files
committed
rephrase Supply.first description
1 parent ffccbfd commit e94d112

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/Type/Supply.pod6

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,19 @@ Creates a "tail" supply with the same semantics as L<List.tail|/type/List#method
374374
375375
method first(Supply:D: :$end, |c)
376376
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
382382
on the invocant, without parameter, the C<head> or the C<tail> method,
383383
according to named parameter C<:end>.
384384
385385
my $rand = supply { emit (rand × 100).floor for ^∞ };
386386
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;
388390
389391
=head2 method rotor
390392

0 commit comments

Comments
 (0)