People, mostly Java people, have sometimes complained about Perl's foreach my $var ( @array ){} coding style.
Reading an article on the new features of Java 1.5, I'm please to note that Java has followed the lead of Perl, and added a foreach construct:
for ( type var : collection_var ) { var.method( .... ); }
The ':' provides the iterator behind th background, so you don't have to confuse your code with an implementation detail.
--
TTTATCGGTCGTTATATAGATGTTTGCA
Fixed <em> tag per author's request - dvergin 2004-07-02
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Java accepts Perl leadership
by Joost (Canon) on Jun 27, 2004 at 16:01 UTC | |
by broquaint (Abbot) on Jun 28, 2004 at 04:33 UTC | |
|
Re: Java accepts Perl leadership
by dws (Chancellor) on Jun 27, 2004 at 16:44 UTC |