This post discusses a draft proposal for adding support for closures to the Java programming language for the Dolphin (JDK 7) release. It was carefully designed to interoperate with the current idiom of one-method interfaces. The latest version of the proposal and a prototype can be found at http://www.javac.info/.
We've just updated the Closures for Java specification, bringing it to v0.5. There are two significant changes:
- We've dropped the nominal version of the specification. We are no longer maintaining parallel versions of the specification (with and without function types) because the most significant concerns regarding function types were resolved in earlier revisions of the spec.
- We added support for user-defined looping APIs. I wrote about this in October 2006, but did not integrate that into the spec until now.