DRAFT PROPOSAL: Implement BGGA Closures for Java

Neal Gafter neal at gafter.com
Tue Feb 26 10:35:06 PST 2008


On Tue, Feb 26, 2008 at 10:09 AM, Charles Oliver Nutter <
charles.nutter at sun.com> wrote:

> 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.


I think invokedynamic is not required (or even particularly helpful) for
implementing this.

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?
>

Actually, I'm working on that separately.  Some of that may be more likely
to make it into JDK7 than closures.  But I wanted to keep the scope of this
proposal focused and well-defined.

Regards,
Neal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/challenge-discuss/attachments/20080226/24fb2c2b/attachment.html 


More information about the challenge-discuss mailing list