Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

malte (1708)

malte
  (email not shown publicly)
http://joose-js.blogspot.com/

Working on Joose JavaScript meta system (Blog) [blogspot.com] and blok [appspot.com], a web based application for collaborative ui prototyping.

Journal of malte (1708)

Monday April 07, 2003
10:55 AM

Making Java enjoyable

[ #11493 ]

What I always hated about Java is that you can't say "I'm going to iterate over this thing" in a single expression. Actually, you can't say it at all. You have to know a lot about how the collection and iterator iterfaces behave, to write it down. This feels really wrong. One of the nice things about statically typed languages is, that you know at compile time that something can be iterated upon, so you might as well be allowed to write it down. Fortunately, perl came to help:

Construct like:

foreach String name (aCollection) {

are turned into

Iterator it = aCollection.iterator();

while(it.hasNext()) {
        String name = it.next();

The script does it very naively. It doesn't really know about Java syntax, but it works for me.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.