Skip to content

Commit 4a59075

Browse files
committed
polymod acting on lazy lists added
Refs #2632
1 parent f37792e commit 4a59075

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Type/Int.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ this code that implements it:
162162
For a more detailed discussion, see
163163
L<this blog post|https://perl6.party/post/Perl6-.polymod-break-up-a-number-into-denominations>
164164
165+
We can use lazy lists in C<polymod>, as long as they are finite:
166+
167+
=for code
168+
my $some-numbers = lazy gather { take 3*$_ for 1..3 };
169+
say 600.polymod( $some-numbers ); # OUTPUT: «(0 2 6 3)␤»
170+
171+
165172
=head2 routine is-prime
166173
167174
Defined as:

0 commit comments

Comments
 (0)