<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>try {} catch () &#187; closures</title>
	<atom:link href="http://blog.gerardin.info/archives/tag/closures/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.gerardin.info</link>
	<description>Java, Agile, the Web and other nice things</description>
	<lastBuildDate>Tue, 14 Jun 2011 09:48:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mark Reinhold&#8217;s proposal for Java closures</title>
		<link>http://blog.gerardin.info/archives/632</link>
		<comments>http://blog.gerardin.info/archives/632#comments</comments>
		<pubDate>Mon, 14 Dec 2009 08:18:07 +0000</pubDate>
		<dc:creator>Olivier Gérardin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[closures]]></category>

		<guid isPermaLink="false">http://blog.gerardin.info/?p=632</guid>
		<description><![CDATA[I believe this proposal, although incomplete, to be much more acceptable to the current Java community than existing BGGA or FCM. Most proposals state that it&#8217;s not the syntax that matters, it&#8217;s the semantics. While this is undoubtedly true, syntax is the first thing a programmer will see and judge the feature by. If the [...]]]></description>
			<content:encoded><![CDATA[<p>I believe this proposal, although incomplete, to be much more acceptable to the current Java community than existing <a href="http://www.javac.info/closures-v05.html" target="_blank" class="liexternal">BGGA</a> or <a href="http://docs.google.com/Doc?id=ddhp95vd_6hg3qhc" target="_blank" class="liexternal">FCM</a>.</p>
<p>Most proposals state that it&#8217;s not the syntax that matters, it&#8217;s the semantics. While this is undoubtedly true, syntax is the first thing a programmer will see and judge the feature by. If the syntax isn&#8217;t self-explanatory enough, it will be a cause of rejection, and the feature will not be used as it could have been. So I do believe syntax is a key point of the future Java closures feature, and in this respect I tend to favor Mak Rheinhold&#8217;s proposal or the FCM proposal rather than BGGA.</p>
<p><a href="http://cr.openjdk.java.net/~mr/lambda/straw-man/" target="_blank" class="liexternal">Mark Rheinhold&#8217;s proposal</a></p>
<p><a href="http://openjdk.java.net/projects/lambda/" target="_blank" class="liexternal">Project Lambda</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.gerardin.info/archives/632/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lambdaj &#8211; easy collection manipulation</title>
		<link>http://blog.gerardin.info/archives/561</link>
		<comments>http://blog.gerardin.info/archives/561#comments</comments>
		<pubDate>Tue, 17 Nov 2009 12:45:07 +0000</pubDate>
		<dc:creator>Olivier Gérardin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[lambdaj]]></category>

		<guid isPermaLink="false">http://blog.gerardin.info/?p=561</guid>
		<description><![CDATA[LambaJ is quite an interesting project. How many times did you write the same loop, with only a few differences that were impossible to factor out because of the lack of closures in Java? LambdaJ partially alleviates the need for closures by allowing the manipulation of Collections in a way that doesn&#8217;t require iterating through [...]]]></description>
			<content:encoded><![CDATA[<p>LambaJ is quite an interesting project. How many times did you write the same loop, with only a few differences that were impossible to factor out because of the lack of closures in Java?</p>
<p>LambdaJ partially alleviates the need for closures by allowing the manipulation of Collections in a way that doesn&#8217;t require iterating through the items. For example you could write</p>
<pre class="prettyprint"><span class="pln">forEach</span><span class="pun">(</span><span class="pln">personInFamily</span><span class="pun">).</span><span class="pln">setLastName</span><span class="pun">(</span><span class="str">"Fusco"</span><span class="pun">);</span></pre>
<p>with personInFamily being a List of Person, and setLastName being a method on the Person class. Actually, forEach returns a proxy that implements both the Iterable interface and the methods of the collection items&#8217; class (Person in this case). A call to any of these methods is then propagated to each member of the collection.</p>
<p>As you can see, LambdaJ uses the DSL-style notation that mock frameworks introduced, which I&#8217;m not particularly fond of; but I must say that in this case it produces quite elegant and readable code.</p>
<p>As a bonus, LambaJ also offers <a href="http://code.google.com/p/lambdaj/wiki/Closures" target="_blank" class="liexternal">its own flavor of closures</a>&#8230;</p>
<p><a href="http://code.google.com/p/lambdaj/" class="liexternal">lambdaj &#8211; Project Hosting on Google Code</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.gerardin.info/archives/561/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

