I download the last Java build b96- Feature Complete for testing the new JDK features but I can't figure out which syntax using for testing closures!
Can I test it?
Which syntax has been approved in the final release?
I download the last Java build b96- Feature Complete for testing the new JDK features but I can't figure out which syntax using for testing closures!
Can I test it?
Which syntax has been approved in the final release?
I can't be certain, but I think this syntax:
// function expressions
#(int i, String s) {
System.println.out(s);
return i + s.length();
}
// function expressions
#(int i, String s) (i + s.length())
// function types
#int(int, String)
Is going to make it through as per http://docs.google.com/Doc?id=ddhp95vd_0f7mcns
To answer your question, no final syntax has been approved and, despite M8 being listed as the feature-complete milestone, it doesn't have all the proposed features. You can read here about the feature in its current form, but much discussion is going on now and it has quite a ways to go. Additionally, the syntax is going to be revisited and likely changed (at least some) later, once more pressing issues are worked out.
Also, project-lambda code is being worked on in a fork of the main line JDK7 (I believe), so I don't think any of it would be in the build you downloaded.