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.
by cowwoc - 2009-11-19 11:09
by forax - 2009-11-19 12: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.
by scotty69 - 2009-11-19 01:26
by markmahieu - 2009-11-18 13:15
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.