Larry Wall writes:
> I think decent formatting would make it clearer:
>
> for @a; @b
> -> $x is rw; y {
> $x = $y[5];
> }
But this isn't very scalable:
for @a; @b;
@c; @d;
@e
-> $a_variable1 is rw, $a_variable2 is rw; $b_variable is rw;
$c_variable is rw; $d_variable is rw;
$e_variable1 is rw, $e_variable2 is rw
{
}
wheras:
for @a -> $a_variable1 is rw, $a_variable2 is rw;
@b -> $b_variable is rw;
@c -> $c_variable is rw;
@d -> $d_variable is rw;
@e -> $e_variable1 is rw, $e_variable2 is rw;
{
}
is much, *much* clearer. IMO the current 'for' syntax suffers from action at a
distance, even if that distance is within the same line. Related things aren't
paired up nearly close enough to each other.
And I'd curse it if I was writing 'for' expressions as complicated as the
second one. Which I WILL do, especially when writing code generators.
Ed