By oehrstroem on Aug 17, 2009
Every new proposal to the Java language and/or the Java Virtual Machine is automatically weighted and compared with the different proposals for closures for the Java Programming Language. The current JSR292 proposal is no exception since the versatile MethodHandle introduced in JSR292 can be used both to implement a closure as well as a stored message.
The implementation of closures and stored messages within a language can be evaluated according to the principles of duality, correspondence and invokability. By doing so we find that MethodHandles have to support co/contra variance and autoboxing as well as implicit downcast/unboxing from Object.
Also, one commonly discussed reason for adding closures to Java is wrong, but I will make up for this by adding a new reason for restricted closures.[Read More]