John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
and it works as expected.my @list1= 1..5; my @list2= <a b c d e>; for each(@list1, @list2) -> $x, $y { say "$x with $y"; }
But S29 I see the example
and when I use zip instead of each in my example, I getfor zip(@a;@b;@c) -> $nth_a, $nth_b, $nth_c { ... }
So what is the effective point of using ; as a parameter separator instead of comma, and why is my use of zip creating strings not lists?1 a with 2 b 3 c with 4 d 5 e with
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [Perl6] comma vs semicolon in 'each' ?
by moritz (Cardinal) on Feb 26, 2008 at 08:45 UTC | |
by John M. Dlugosz (Monsignor) on Feb 27, 2008 at 00:22 UTC | |
by moritz (Cardinal) on Feb 27, 2008 at 08:49 UTC | |
by John M. Dlugosz (Monsignor) on Feb 27, 2008 at 09:01 UTC | |
by TimToady (Parson) on Feb 27, 2008 at 17:27 UTC | |
|