The Artima Developer Community
Sponsored Link

Java Buzz Forum
Groovy Closures

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Groovy Closures Posted: Jan 14, 2005 5:39 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Groovy Closures
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
Mike has put together another well researched article on Groovy Closures. He discusses what they are, how they work now, and some ideas on how he would fix them. In Mikes world you would end up going from: [1, 2, 3, 4].each { | param | println param } to (params, clos keyword, no more |, no optional ;): [1, 2, 3, 4].each (clos(param) { println param }); NOTE: Although Mike shows the form: { foo | ... } Groovy supports { | foo | ... } and has even talked about enforcing that. I understand his points, and from a Java perspective it makes even more sense. However I think Charles Miller had a really good point... showing the power of perspective :) Other things you complain about are very Ruby-like, but it helps to phrase them differently. For example, Ruby hackers wouldn't say that a return statement was optional, they'd say that all methods return the value of the last statement in the method, but this behaviour can be overridden by an explicit return. (It's a subtle difference of point-of-view). Similarly, in Ruby, you wouldn't say that semi-colons are optional. You'd say that the newline was the default statement separator, but you can force an end-of-statement with a semi-colon. It is funny how actual work changes things. The more code I write in languages which don't require a ';' every 30 keystrokes, the more it bugs me when I have to go back to typing them, and more importantly seeing them on every line or so. What a load of clutter! :)

Read: Groovy Closures

Topic: [Jan 6, 2005 16:12 PST] 5 Links Previous Topic   Next Topic Topic: Harder to find power than WiFi

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use