DRAFT PROPOSAL: Implement BGGA Closures for Java

Charles Oliver Nutter charles.nutter at sun.com
Tue Feb 26 10:09:11 PST 2008


Neal Gafter wrote:
> Yes, I will need to put it in plain-text format.
> 
> This is not intended to bypass the JCP or to propose changes to the 
> language specification, but rather to provide a complete implementation 
> of one option.  I can certainly imagine that other proposals might take 
> part in the challenge as well.  This proposal augments BGGA with "method 
> references", which appears to be the main reason that some people prefer 
> another approach. Still, my reference to the poll is probably not 
> constructive; I certainly don't believe in language design by popular 
> vote.  Realistically, closures may not make it into JDK7 due to schedule 
> pressures; JDK8 may be more realistic.  We'll know more once Sun 
> provides some schedule guidance.

I believe method references will go hand in hand with invokedynamic's 
likely support for lightweight method handles. Given one, the other 
seems natural.

On the general BGGA proposal, perhaps there's also room for considering 
general type inference as an addition to OpenJDK? One problem I've had 
with BGGA is that it (necessarily for sanity) adds type-inferencing 
logic to reduce the complexity of declarations...but we end up leaving 
the rest of Java out in the cold without broader support. I for one 
would like to see such type inferencing added globally, both because it 
seems like a natural progression, it's compatible with all existing Java 
syntax, and it's obviously very useful for reducing the noise of 
generics, anon inner classes, and closures.

Thoughts?



More information about the challenge-discuss mailing list