in reply to [Perl6] comma vs semicolon in 'each' ?

Pugs' behaviour was correct at the time it was implemented, but it doesn't conform ot the current status of the synopsis.

pugs doesn't really know about the "slice" context, which is something like a non-flattening list context.

So the S29 example is fine, although I like the infix zip ooperator Z better:

for @a Z @b Z @c -> $x, $y, $z -> { .... }

So whatever you do, don't confund pugs and S\d\d ;-)

Replies are listed 'Best First'.
Re^2: [Perl6] comma vs semicolon in 'each' ?
by John M. Dlugosz (Monsignor) on Feb 27, 2008 at 00:22 UTC
    What about each? I don't see that in S29.
      Dunno.

      In Perl 6 you use %hash.kv to iterate over hashes, and if you want to interate over arrays and get the index at the same time, you use @list Z ^@list or even @list Z 0 .. *. (Note that lists are lazy, so a list of all items is essentially the same as an iterator).

      So what would you use each for?

        Well, in Pugs it is doing something different for zip that I don't quite follow, and supports each. So that's all old news? What was the difference, in mid-2007, just out of curiosity?

        —John
        in Allen, Texas (Dallas metroplex)