28
Sep
09

Selah

I literally sighed when I read this about REXML, the XML parser for Ruby:

Some of the common differences are that the Ruby API relies on block enumerations, rather than iterators. For example, the Java code:

for (Enumeration e=parent.getChildren(); e.hasMoreElements(); ) {
  Element child = (Element)e.nextElement(); // Do something with child
}

In Ruby beccomes

parent.each_child{ |child| # Do something with child }
Advertisements

0 Responses to “Selah”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.


%d bloggers like this: