Summary
Neal Gafter released the first prototype implementation of the closures proposal for Java 6.
Advertisement
Adding closures to the Java language is among the most hotly debated—and considered by many to be the most desirable—additions to Java since generic types were introduced three years ago. The proposal for Java closures has seen several competing versions, which converged to a single specification drafted by Neal Gafter and a group of experts in preparation for a JSR submission.
Neal Gafter has recently released an implementation of this proposal with the following features:
BGGA function type syntax
Closure literals
Closure conversion
The null type, disjunctive types, and exception transparency
Definite assignment
Unreachable and completion transparency.
Catching multiple exceptions at once like catch(X1|X2 ex) { ...
[not closely related to closures but the implementation was simple once closures are there]
Missing from this implementation are :
A closure using a mutated variable from the enclosing scope
Nonlocal control-flow (break, return, and continue)
The control invocation statement and loop abstractions
What do you think of the closures proposal and the first prototype?
In addition to what's already there, and beyond the items the prototype doesn't yet support, there's two features I would be most interested in seeing.
The other is mentioned in comments: method reference syntax (http://docs.google.com/View?docid=ddhp95vd_6hg3qhc). A quick review makes it seem like using an existing nested class vs a new anonymous class, but at the method level.
All in all, exciting changes are (hopefully) coming to Java!