In Exegesis 4, Damian writes:

<blockquote>
It's important to note that writing:


    for @a; @b -> $x; $y {...}
    # in parallel, iterate @a one-at-a-time as $x, and @b one-at-a-time as
$y

is not the same as writing:


    for @a, @b -> $x, $y {...}
    # sequentially iterate @a then @b, two-at-a-time as $x and $y
</blockquote>

Now, I love that the for loop can do both of these things, but the subtlety
of the difference in syntax is likely, IMO, to lead to very difficult-
to-find bugs. It's very easy to miss that I've used a comma when I meant to
use a semicolon, and vice versa. And what's the mnemonic again?

Is there any way the syntax could be made different? Could the two
approaches be differently named? Perhaps the first could be C<foreach>, and
the second could be C<for>, and they could both use commas. Or am I just
being paranoid?

Regards,

David

-- 
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]


Reply via email to