April 29, 2007
Opening the Pandora's Box of Closures
At JavaOne, closures will be discussed in sessions on JRuby, Scala, and Groovy, and Neal Gafter will talk about bringing closures to Java.
Gafter has talked about this before. Eric Bruno looked at the prospect of closures in Java here back in September, and there's a nice piece on the topic at IBM's DeveloperWorks.
More than one poll of developers has shown significant interest in adding closures to Java, but you often hear calls to consider the cost/benefit picture. Plus requests not to build another camel. There are two proposals on the table for ways of going about it, neither without its drawbacks. You can extend the type system of the language to allow function types, which Gafter promotes, the so-called BGGA proposal (Gafter is the first G; the second is Gosling), or you can fiddle with the creation of inner class instances. The former is the more radical retrofit.
It will be interesting, to put it mildly, to see if some consensus comes out of Gafter's sessions at JavaOne.
Posted by Mike Swaine at 12:29 PM Permalink
|