Closures/Value capture: Difference between revisions

Line 952:
 
=={{header|Perl 6}}==
{{Works with|Rakudo|2015.12}}
All blocks are anonymous closures in Perl 6, and parameters are lexicals, so it's easy to generate a list of them. We'll use a <tt>gather</tt>/<tt>take</tt> generator loop, and call the closures in random order, just to keep things interesting.
<lang perl6>my @c = gather for ^10 -> $i {
Anonymous user