<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Ruby coolness #1: Blocks</title>
	<atom:link href="http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/</link>
	<description>Life, .NET, and Cats</description>
	<pubDate>Sun, 12 Oct 2008 07:20:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: jojotdfb</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5083</link>
		<dc:creator>jojotdfb</dc:creator>
		<pubDate>Tue, 30 Jan 2007 01:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5083</guid>
		<description>Forgive my ignorance, but how is this different from tcl or lisp? What am I missing?
</description>
		<content:encoded><![CDATA[<p>Forgive my ignorance, but how is this different from tcl or lisp? What am I missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5082</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Mon, 29 Jan 2007 22:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5082</guid>
		<description>C# isn't that different as you state, sometimes even easier:&lt;br&gt;&lt;br&gt;[Test]&lt;br&gt;[ExpectedException(typeof(InvalidOperationException))]&lt;br&gt;public void ExpectAnExceptionByType()&lt;br&gt;{&lt;br&gt;    /* ... */&lt;br&gt;}&lt;br&gt;&lt;br&gt;A attribute can do the same. This is NUnit's but you can write your own. Not as nice but the logic is kept in one method as you require.&lt;br&gt;&lt;br&gt;public IEnumerator traverse()&lt;br&gt;{&lt;br&gt;    left.traverse();&lt;br&gt;    yield this;&lt;br&gt;    right.traverse();&lt;br&gt;}&lt;br&gt;&lt;br&gt;Even easier, I think.&lt;br&gt;&lt;br&gt;using (Stream file = File.OpenRead(&#34;foo.txt&#34;))&lt;br&gt;{&lt;br&gt;    // do stuff with file&lt;br&gt;}&lt;br&gt;&lt;br&gt;Exactly the same and more efficient since no method invocation is made.&lt;br&gt;&lt;br&gt;Off course, this aren't true closures but other features of C# that allow the same things you are (ab?)using closures for on Ruby.&lt;br&gt;
</description>
		<content:encoded><![CDATA[<p>C# isn&#8217;t that different as you state, sometimes even easier:</p>
<p>[Test]<br />
<br />[ExpectedException(typeof(InvalidOperationException))]<br />
<br />public void ExpectAnExceptionByType()<br />
<br />{<br />
<br />    /* &#8230; */<br />
<br />}</p>
<p>A attribute can do the same. This is NUnit&#8217;s but you can write your own. Not as nice but the logic is kept in one method as you require.</p>
<p>public IEnumerator traverse()<br />
<br />{<br />
<br />    left.traverse();<br />
<br />    yield this;<br />
<br />    right.traverse();<br />
<br />}</p>
<p>Even easier, I think.</p>
<p>using (Stream file = File.OpenRead(&quot;foo.txt&quot;))<br />
<br />{<br />
<br />    // do stuff with file<br />
<br />}</p>
<p>Exactly the same and more efficient since no method invocation is made.</p>
<p>Off course, this aren&#8217;t true closures but other features of C# that allow the same things you are (ab?)using closures for on Ruby.<br />
</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5081</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Mon, 29 Jan 2007 20:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5081</guid>
		<description>An excellent description of closures/blocks and why they are useful.  Thanks.
</description>
		<content:encoded><![CDATA[<p>An excellent description of closures/blocks and why they are useful.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimmy</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5080</link>
		<dc:creator>jimmy</dc:creator>
		<pubDate>Mon, 29 Jan 2007 15:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5080</guid>
		<description>awsome
</description>
		<content:encoded><![CDATA[<p>awsome</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: no</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5079</link>
		<dc:creator>no</dc:creator>
		<pubDate>Tue, 17 Jan 2006 16:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5079</guid>
		<description>ruby makes me happy.
</description>
		<content:encoded><![CDATA[<p>ruby makes me happy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mel Riffe</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5078</link>
		<dc:creator>Mel Riffe</dc:creator>
		<pubDate>Mon, 01 Aug 2005 13:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5078</guid>
		<description>I think you want to check out Martin Fowler's blog entry today: &lt;a target="_new" href="http://martinfowler.com/bliki/CollectionClosureMethod.html" rel="nofollow"&gt;http://martinfowler.com/bliki/CollectionClosureMethod.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;Ciao...
</description>
		<content:encoded><![CDATA[<p>I think you want to check out Martin Fowler&#8217;s blog entry today: <a target="_new" href="http://martinfowler.com/bliki/CollectionClosureMethod.html" rel="nofollow">http://martinfowler.com/bliki/CollectionClosureMethod.html</a></p>
<p>Ciao&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe White's Blog</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5086</link>
		<dc:creator>Joe White's Blog</dc:creator>
		<pubDate>Wed, 06 Jul 2005 04:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5086</guid>
		<description>&lt;strong&gt;I see refactorings&lt;/strong&gt;


</description>
		<content:encoded><![CDATA[<p><strong>I see refactorings</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby noob</title>
		<link>http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5085</link>
		<dc:creator>Ruby noob</dc:creator>
		<pubDate>Sat, 11 Jun 2005 21:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/05/18/ruby-coolness-1-blocks/#comment-5085</guid>
		<description>I think ruby is really nice. I am just learning how to use it too.
</description>
		<content:encoded><![CDATA[<p>I think ruby is really nice. I am just learning how to use it too.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
