Loops/Foreach: Difference between revisions

m
Line 2,275:
for @collection { .say };</lang>
Iteration can also be done with hyperoperators. In this case it's a candidate for autothreading and as such, execution order may vary. The resulting list will be in order.
<lang per6perl6>@collection>>.say;
@collection>>.=&infix:<+>(2); # increment each element by 2</lang>
 
10,327

edits