Lite closure in JDK7
Posted by forax on November 18, 2009 at 11:58 AM EST
It seems that "lite" closure will be in JDK7.
I really don't care about the surface syntax but I hope that the runtime of such closure will be on top of JSR 292 method handle.
cheers,
Rémi
Related Topics >>
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- forax's blog
- 3085 reads






Comments
WTF?!
by cowwoc - 2009-11-19 12:09
There are so many other feature requests that have more consensus and are better for Java than Closures. Why ram this down our throats now?!WTF WTF ?
by forax - 2009-11-19 13:22
I don't know why others want closures but I know why I need them. Recently, I have ported a Ruby code to Java, don't ask me why it was first developed in Ruby. It is a not so simple code that see a graph of node as another graph of node. For a question of performance this code has to be lazy, The size of the Java code is 5 times the size of the Ruby code because conceptually the Ruby code use only 4 kind of closure to do the conversions but in Java in order to avoid boxing I had to write a lot of interfaces with one method that takes a char, an int, a long, an Object, etc.. I have more than one hundred of such interfaces. Ok, the Java code is faster (3x) than the Ruby code, but it was a pain in the ass to write.
JDK7 release is postpone because of the Sun/Oracle deal, so we have more time, let's try to implement a consensus version of closure.
+1
by scotty69 - 2009-11-19 02:26
This one will bring back fun into hacking Java!BGGA spec has been updated to v06a
by markmahieu - 2009-11-18 14:15
http://www.javac.info/closures-v06a.html