<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Weiqi Gao&#039;s Observations - closures tag</title>
  <link>http://www.weiqigao.com/blog/tags/closures/</link>
  <description>Sharing My Experience...</description>
  <language>en</language>
  <copyright>Weiqi Gao</copyright>
  <lastBuildDate>Fri, 11 May 2012 12:48:36 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>Weiqi Gao&#039;s Observations</title>
    <link>http://www.weiqigao.com/blog/</link>
  </image>
  
  
  <item>
    <title>Closures In Java 7: It&#039;s On Again</title>
    <link>http://www.weiqigao.com/blog/2009/11/18/closures_in_java_7_its_on_again.html</link>
    
      
        <description>
          &lt;blockquote&gt;
&lt;p&gt;&lt;a href= &#034;http://puredanger.com/tech/2009/11/18/closures-after-all/&#034; &gt;Alex Miller&lt;/a&gt;: Apparently Mark Reinhold announced that closures would be added to JDK 7 at Devoxx today: &lt;/p&gt;

&lt;center&gt;
&lt;a href=&#034;http://twitpic.com/pz3hn&#034;&gt;
&lt;img src=&#034;http://puredanger.com/techfiles/43627883.jpg&#034; /&gt;
&lt;/a&gt;
&lt;/center&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am, well, surprised.  Having &lt;a href= &#034;http://www.weiqigao.com/blog/tags/closures/&#034; &gt;commented on closures in Java&lt;/a&gt; somewhat verbosely in the past, I don&#039;t have any words left in me about this topic, except &#034;whatever!&#034;&lt;/p&gt;

&lt;p&gt;I&#039;ll believe it when I see it.  Remember, they promised XML literals for Java 7, and I&#039;m still bitter that they dropped it. &lt;tt&gt;:(&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Coincidentally, Neal Gafter, of Microsoft dotNet platform languages group, posted a simplified proposal for &lt;a href= &#034;http://www.javac.info/closures-v06a.html&#034; &gt;Closures for Java (v0.6a)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For those who don&#039;t follow my blog, my position has always been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not adding closure to Java will kill Java&lt;/li&gt;
&lt;li&gt;The death (or the absence of evolution) of Java the language will render the JVM the platform anemic&lt;/li&gt;
&lt;li&gt;An anemic JVM platform will suffocate parasitic JVM languages like Scala and Groovy while at the same time decrease its attractiveness as an alternative implementation platform for other scripting languages (JRuby, Jython, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, it&#039;s a Good Thing&lt;sup style=&#034;font-size:large&#034;&gt;&amp;trade;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;[&lt;b&gt;Update&lt;/b&gt;] I consulted the I Ching, the ancient Chinese Oracle, on the meaning of this matter, and received the following gua:&lt;/p&gt;

&lt;blockquote&gt;
&lt;a href= &#034;http://www.guoxue.com/jinbu/13jing/zhouyi/zy_001.htm&#034; &gt;I Ching (ca. 900 B.C.)&lt;/a&gt;: 否（坤下乾上）&lt;br/&gt;
《否》：否之匪人，不利君子贞，大往小来。&lt;br/&gt;
 初六，拔茅茹以其汇。贞吉，亨。&lt;br/&gt;
 六二，包承，小人吉，大人否。亨。&lt;br/&gt;
 六三，包羞。&lt;br/&gt;
 九四，有命，无咎，畴离祉。&lt;br/&gt;
 九五，休否，大人吉。其亡其亡，系于苞桑。&lt;br/&gt;
 上九，倾否，先否后喜。
&lt;/blockquote&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2009/11/18/closures_in_java_7_its_on_again.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2009/11/18/closures_in_java_7_its_on_again.html</guid>
    <pubDate>Thu, 19 Nov 2009 05:27:07 GMT</pubDate>
  </item>
  
  <item>
    <title>Microsoft: Closures And The Java VM</title>
    <link>http://www.weiqigao.com/blog/2008/09/27/microsoft_closures_and_the_java_vm.html</link>
    
      
        <description>
          &lt;p&gt;&lt;em&gt;(Via &lt;a href= &#034;http://groups.google.com/group/clojure/browse_thread/thread/4c4a4e6500d06f8f?hl=en&#034; &gt;Clojure Google Group&lt;/a&gt;.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In light of the &lt;a href= &#034;http://www.weiqigao.com/blog/2008/09/26/neal_gafter_to_join_microsoft.html&#034; &gt;news from yesterday&lt;/a&gt;, one shouldn&#039;t be shocked too much by this.  Yet I find myself stunned by the following visual:&lt;/p&gt;

&lt;center&gt;
&lt;a href= &#034;http://wiki.jvmlangsummit.com/pdf/35_Gafter_closures.pdf&#034;&gt;
&lt;img src=&#034;http://www.weiqigao.com/blog/images/microsoft-java-closures.png&#034; title=&#034;Microsoft: Closures And The Java VM&#034; alt=&#034;Microsoft: Closures And The Java VM&#034; width=&#034;420&#034; height=&#034;379&#034; /&gt;
&lt;/a&gt;
&lt;/center&gt;

&lt;p&gt;Also, check out the blogroll at &lt;a href= &#034;http://gafter.blogspot.com/&#034; &gt;http://gafter.blogspot.com/&lt;/a&gt; (at least until it is further updated).&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2008/09/27/microsoft_closures_and_the_java_vm.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2008/09/27/microsoft_closures_and_the_java_vm.html</guid>
    <pubDate>Sun, 28 Sep 2008 01:45:43 GMT</pubDate>
  </item>
  
  <item>
    <title>Friday C# Quiz: Know Your Closures</title>
    <link>http://www.weiqigao.com/blog/2008/05/02/friday_c_quiz_know_your_closures.html</link>
    
      
        <description>
          &lt;p&gt;Although I&#039;ve &lt;a href= &#034;http://www.weiqigao.com/blog/2008/04/04/friday_c_quiz_know_your_closures.html&#034; &gt;vowed not to&lt;/a&gt; post about closures anymore, I can&#039;t help but post one more quiz.  I know Friday is mostly over for many of my readers, but there are still a few time zones left.&lt;/p&gt;

&lt;p&gt;Without downloading &lt;a href= &#034;http://www.microsoft.com/express/download/&#034; &gt;Microsoft Visual C# 2008 Express Edition&lt;/a&gt; and compiling the following C# source file, answer the following question:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Q&lt;/b&gt;: Will the following program&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;public &lt;span style=&#034;color:red&#034;&gt;delegate&lt;/span&gt; int &lt;span style=&#034;color:green&#034;&gt;IntToInt&lt;/span&gt;(int i);

public class Foo {
  public static &lt;span style=&#034;color:green&#034;&gt;IntToInt&lt;/span&gt; &lt;span style=&#034;color:purple&#034;&gt;fib&lt;/span&gt; =
    n &lt;span style=&#034;color:red&#034;&gt;=&gt;&lt;/span&gt; n == 0 ? 0 :
         n == 1 ? 1 :
         &lt;span style=&#034;color:purple&#034;&gt;fib&lt;/span&gt;(n - 1) + &lt;span style=&#034;color:purple&#034;&gt;fib&lt;/span&gt;(n - 2);

  public static void Main() {
    System.Console.WriteLine(fib(6));
  }
}&lt;/pre&gt;

&lt;p&gt;compile? Run?  If so, what will it print out?&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2008/05/02/friday_c_quiz_know_your_closures.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2008/05/02/friday_c_quiz_know_your_closures.html</guid>
    <pubDate>Sat, 03 May 2008 03:14:58 GMT</pubDate>
  </item>
  
  </channel>
</rss>

