> Angel> Could we have:
>
> Angel> foreach $item in @arr {...}
>
> Angel> Instead of
>
> Angel> foreach @arr -> $item {...}
>
> Larry considered that, and declined. Not sure of the reasons.
* He didn't want a keyword that would become lost when lots of variables
or sub calls are used in the setup.
* Using "in" doesn't work well linguistically with "given", "sort",
"map", etc:
given $var in $x {...}
@data = sort in $i, $j {...} @data;
@data = map in $x {...} @data;
* The left-to-right sequencing of -> keeps the data near the "for" and
the aliases near the block.
* Gives the poor discarded -> a new lease on life as a synonym for "sub"
* New inline code smiley face possible:
my $sum =-> @data { shift @data + $sum(@data) }
;-)
Damian
PS: It's "for" not "foreach". "Tharrrr ken beeeee onla wun!"