Java 7 Special Edition – Closures and Language Change JSRs!

8

I had just published a Java 7 roundup when I got an email from a little birdy in my inbox: JUGs to propose new language JSR for Java 7!

This message reveals that the “Closures for Java” JSR has been submitted as a joint proposal of the Belgian and Brazilian Java Users Groups!! This is the first proposal ever by a JUG – very cool.

Additionally, a collection of smaller language changes has been submitted as a Google-led proposal and will include:

As always, all current and previous information is maintained on my Java 7 page, which has now been updated based on the info in this announcement.

Comments

8 Responses to “Java 7 Special Edition – Closures and Language Change JSRs!”
  1. paulo says:

    To make chained Invocations works in a way that does not suck (ie casts) we would have to have a public this do() signature (i forget the technical term) for subclasses to work. We don’t want those operations to just return the superclass or interface. Maybe the idea of automatic cast is more appropriate here than it was in generics? Make the compiler cast void methods if they are invoked. That presumes a minimal lookahead i think and java frowns on that. But very much a wanted feature…

  2. Matthias says:

    Paulo,

    my chained invocation proposal already implements the semantics you are thinking of. An invocation of a “void” method would have the same type as the invocation target – not of the class that implements the method.

    So if A defines “void f()” and B extends A, then new B().f() will have type “B”.

    Matthias

Trackbacks

Check out what others are saying about this post...
  1. [...] More info: Closures, Extension Methods [...]

  2. [...] More info: Closures, Extension Methods [...]

  3. [...] Java 7 seems to be pulling at the coat-tails of this feature set, with the slow but steady progress on closures, extension methods, and type inference. But when you look a little closer at the proposals for these, they’ve kind of gone through the looking glass to fit into Java’s static typing and backwards compatibility requirements. And what’s on the other side is a little weird. [...]

  4. [...] With the recent surge in Java closures blogs, I thought I would do a roundup on some recent hot topics. Probably the most important development is that we now have prototypes for the three major closures proposals. That means it’s time for the steel cage death match!Ok, I guess that’s not really necessary. But we do have the tools now to do a comparison on syntax and functionality of these proposals: [...]

  5. [...] Pure Danger Tech: Closures in Java 7 [...]



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!