The Artima Developer Community
Sponsored Link

Java Community News
Neal Gafter Releases First Java Closures Prototype

1 reply on 1 page. Most recent reply: Oct 31, 2007 8:09 AM by Daniel Jimenez

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Neal Gafter Releases First Java Closures Prototype Posted: Oct 30, 2007 11:57 AM
Reply to this message Reply
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?


Daniel Jimenez

Posts: 40
Nickname: djimenez
Registered: Dec, 2004

Re: Neal Gafter Releases First Java Closures Prototype Posted: Oct 31, 2007 8:09 AM
Reply to this message Reply
This is indeed exciting. Like Ricky (http://rickyclarkson.blogspot.com/2007/10/life-in-old-java-yet-closures-prototype.html), I love playing around with the new syntax.

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.

One is mentioned by Neal himself: extension methods (http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx). I for one have no problem stealing some of the great ideas coming from C#, and have lusted after this feature since I first heard of it.

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!

Flat View: This topic has 1 reply on 1 page
Topic: Microsoft Releases New JDBC Driver for SQLServer Previous Topic   Next Topic Topic: Atlassian Releases Clover 2.0

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use