Most Perl 6 will look like Perl 5
Mark Overmeer
mark at overmeer.net
Fri Jan 25 10:32:14 GMT 2008
* Jonathan Stowe (jns at gellyfish.com) [080125 09:59]:
> > for my $t (0 .. 6) {
> > for 0..6 -> $t {
>
> change in syntax for no apparent benefit. Now I am sure someone is going
> to reply "but but ... ", and I can assure that the wrong answer will be
> to explain it to *me* in relation to some fashionable CS idea or
> functional programming paradigm or whatever.
The advantage is that
for my($x,$y) (@x;@y) {
is quite clumpsy (if feasible to implement at all)
But
for @x, at y -> $x,$y
is possible.
But most importantly, "->" is used for nameless subroutines in Perl6,
so the $t is seen as parameter to that subroutine, and the body of the
for is nothing different than a sub.
Listing the parameters before the "sub" keyword would be quite weird -
although we have seen worse in our history ;-b
--
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the london.pm
mailing list