gafter.blogspot.com
Neal Gafter's blog: December 2007
http://gafter.blogspot.com/2007_12_01_archive.html
Thoughts about Programming Languages, Science and Philosophy. Thursday, December 13, 2007. What flavor of closures? An object with a function accepting pairs of objects, one of * type T and one of type U, returning those of type V */ interface Combiner T,U,V { V combine(T t, U u); } class ParallelArray T { /* * Returns a ParallelArray containing results of applying * combine(thisElement, otherElement) for each element. */ U,V ParallelArray V combine( ParallelArray U other, Combiner? Part of his talk was ...
tronicek.blogspot.com
Zdeněk Troníček's blog: January 2008
http://tronicek.blogspot.com/2008_01_01_archive.html
Monday, January 7, 2008. In this post, I express my opinion on many places. For example, when I say "it is more intuitive.", I mean "in my opinion, it is more intuitive.". As we already mentioned, closures are transformed to anonymous inner classes at compile time. So, all we can do with closures, can be done with inner classes as well. However, the access to local variables may require a little effort. For example, the code. Int x = 4; { = System.out.println( x); }.invoke();. Static double determineFini...
tronicek.blogspot.com
Zdeněk Troníček's blog: March 2008
http://tronicek.blogspot.com/2008_03_01_archive.html
Saturday, March 29, 2008. Method references (Implementation Issue). Method references (Implementation Issue). Each method reference is transformed to a closure:. Math#sqrt(double) will be transformed to { double d = Math.sqrt(d) } { double = double } sqrt = Math#sqrt(double);. Instance method references are transformed in a similar way. Circle c = new Circle(); { = void } p = c#draw(); / the same as { = c.draw(); }. Circle = void } p = Circle#draw(); / { Circle c = c.draw(); }. And refer to the. Knowledg...
tronicek.blogspot.com
Zdeněk Troníček's blog: August 2008
http://tronicek.blogspot.com/2008_08_01_archive.html
Tuesday, August 19, 2008. Method modifier 'for' enables us to declare and call "loop-like" methods. Static for void eachEntry(int[] values, { int = void } block) { for (int p : values) { block.invoke(p); } } public static void main(String[] args) { int[] v = { 2, 3, 5, 7, 11 }; for eachEntry(int i : v) { System.out.println(i); if (i 3) { break; } } }. For example, we can declare a method that iterates through a map:. Posted by Zdeněk Troníček. In unrestricted closures, we can use the. Static int m1() { /...
tronicek.blogspot.com
Zdeněk Troníček's blog: June 2010
http://tronicek.blogspot.com/2010_06_01_archive.html
Friday, June 18, 2010. RefactoringNG is a flexible and powerful Java refactoring tool, implemented as NetBeans module. Refactoring rules are described as transformations of source abstract syntax trees to destination abstract syntax trees. For example, the rule that rewrites. X = x 1 - x Assignment { Identifier [name: "x"], Binary [kind: PLUS] { Identifier [name: "x"], Literal [kind: INT LITERAL, value: 1] } } - Unary [kind: POSTFIX INCREMENT] { Identifier [name: "x"] }. Posted by Zdeněk Troníček.
tronicek.blogspot.com
Zdeněk Troníček's blog: Do we really need <> in the diamond operator?
http://tronicek.blogspot.com/2011/03/do-we-really-need-in-diamond-operator.html
Sunday, March 6, 2011. Do we really need in the diamond operator? As you may know, one of new features of upcoming Java 7 will be the diamond operator. Purpose of the diamond operator is to simplify instantiation of generic classes. For example, instead of. List Integer p = new ArrayList Integer ();. With the diamond operator we can write only. List Integer p = new ArrayList ();. And let compiler infer the value of type argument. Nice simplification. But do we really need to write. The proponents of the.
tronicek.blogspot.com
Zdeněk Troníček's blog: August 2010
http://tronicek.blogspot.com/2010_08_01_archive.html
Tuesday, August 3, 2010. API evolution with RefactoringNG. See my article API evolution with RefactoringNG. Posted by Zdeněk Troníček. Subscribe to: Posts (Atom). API evolution with RefactoringNG. The Closures for Java homepage. 50 ways to say Hello World.
tronicek.blogspot.com
Zdeněk Troníček's blog: February 2008
http://tronicek.blogspot.com/2008_02_01_archive.html
Monday, February 25, 2008. Control Abstraction (version 2008-02-22). Control Abstraction (version 2008-02-22). In this post, I will describe new features of version 2008-02-22 of the compiler prototype. It can be downloaded from http:/ www.javac.info. Was added. It may annotate a variable bound in a closure. For example:. We should always annotate bound variables with this annotation because bound variables are very different from ordinary local variables. Int = int } sum = { int n = n = 1? Public static...
tronicek.blogspot.com
Zdeněk Troníček's blog: March 2011
http://tronicek.blogspot.com/2011_03_01_archive.html
Sunday, March 6, 2011. Do we really need in the diamond operator? As you may know, one of new features of upcoming Java 7 will be the diamond operator. Purpose of the diamond operator is to simplify instantiation of generic classes. For example, instead of. List Integer p = new ArrayList Integer ();. With the diamond operator we can write only. List Integer p = new ArrayList ();. And let compiler infer the value of type argument. Nice simplification. But do we really need to write. The proponents of the.
tronicek.blogspot.com
Zdeněk Troníček's blog: December 2007
http://tronicek.blogspot.com/2007_12_01_archive.html
Friday, December 28, 2007. The Debate over Closures for Java. Gilad Bracha, Neal Gafter, James Gosling, and Peter von der Ahé: Closures for Java (v0.5). This is known as BGGA proposal. JSR Proposal: Closures for Java. Closures for Java (video). Neal Gafter JavaPolis 2006 interview. An interview with Neal Gafter on Artime. Joshua Bloch presentation at JavaPolis 2007. Currying and Partial Application with Java Closures. An unrestricted closure example. Java 7: The Closure Debate. Posted by Zdeněk Troníček.