hcchien raised the following question on #perl6[1]:

If I want to loop through a nine-element array three elements at a time, I do

my @a = 1..9;
for @a -> $x, $y, $z { say $x }

But what if I don't care about the elements 1,4,7? Would the following
be a sane syntax?

my @a = 1..9;
for @a -> undef, $x, $y { say $x }

FWIW, to me it looks fairly intuitive. undef here means "don't alias
the element, just throw it away"... gaal joked about using _ instead
of undef. :)

If the appropriate authority (p6l or @larry) likes this idea, I can
add a few tests to that end in the pugs tree.


Reply via email to