We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68dbbe6 commit a1d7140Copy full SHA for a1d7140
doc/Type/Any.pod6
@@ -174,9 +174,10 @@ C<duckmap> will apply C<&block> on each element and return a new list with
174
defined return values of the block. For undefined return values, C<duckmap>
175
will try to descend into the element if that element implements C<Iterable>.
176
177
- my @a = [1,[2,3],4];
178
- dd @a.duckmap({ $_ ~~ Int ?? $_++ !! Any });
179
- # OUTPUT: «(1, (2, 3), 4)»
+ <a b c d e f g>.duckmap(-> $_ where <c d e>.any { .uc }).say;
+ OUTPUT: «(a b C D E f g)»
+ (('d', 'e'), 'f').duckmap(-> $_ where <e f>.any { .uc }).say;
180
+ OUTPUT: «((d E) F)»
181
182
=head2 method flat
183
0 commit comments