<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Playing with blocks : Part 1</title>
	<atom:link href="http://www.rubyfleebie.com/playing-with-blocks-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyfleebie.com/playing-with-blocks-part-1/</link>
	<description>Because programming should be fun</description>
	<lastBuildDate>Wed, 04 Jan 2012 05:17:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Frank</title>
		<link>http://www.rubyfleebie.com/playing-with-blocks-part-1/comment-page-1/#comment-230</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Wed, 30 May 2007 22:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/playing-with-blocks-part-1/#comment-230</guid>
		<description>rx and Shadowfiend,

You&#039;re both right! I&#039;m going to update the original post about that.

rx, sorry. I don&#039;t know why your comment got marked as spam by Askimet.</description>
		<content:encoded><![CDATA[<p>rx and Shadowfiend,</p>
<p>You&#8217;re both right! I&#8217;m going to update the original post about that.</p>
<p>rx, sorry. I don&#8217;t know why your comment got marked as spam by Askimet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shadowfiend</title>
		<link>http://www.rubyfleebie.com/playing-with-blocks-part-1/comment-page-1/#comment-229</link>
		<dc:creator>Shadowfiend</dc:creator>
		<pubDate>Wed, 30 May 2007 17:32:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/playing-with-blocks-part-1/#comment-229</guid>
		<description>I believe in order to pass a block as an &amp;-prefixed parameter, you have to prefix it with an &amp;, as well. So:

@greasy_food_you_eat_on_fridays.each(code_block)

Would instead be:

@greasy_food_you_eat_on_fridays.each(&amp;code_block)

Moreover, you should still be able to use yield in those situations. You should also be able to use block_given? in either situation instead of comparing to nil, which I find clearer.

Nice post :-)</description>
		<content:encoded><![CDATA[<p>I believe in order to pass a block as an &amp;-prefixed parameter, you have to prefix it with an &amp;, as well. So:</p>
<p>@greasy_food_you_eat_on_fridays.each(code_block)</p>
<p>Would instead be:</p>
<p>@greasy_food_you_eat_on_fridays.each(&amp;code_block)</p>
<p>Moreover, you should still be able to use yield in those situations. You should also be able to use block_given? in either situation instead of comparing to nil, which I find clearer.</p>
<p>Nice post :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morning Brew #15</title>
		<link>http://www.rubyfleebie.com/playing-with-blocks-part-1/comment-page-1/#comment-228</link>
		<dc:creator>Morning Brew #15</dc:creator>
		<pubDate>Tue, 29 May 2007 11:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/playing-with-blocks-part-1/#comment-228</guid>
		<description>[...] Playing with blocks : Part 1 [...]</description>
		<content:encoded><![CDATA[<p>[...] Playing with blocks : Part 1 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rx</title>
		<link>http://www.rubyfleebie.com/playing-with-blocks-part-1/comment-page-1/#comment-227</link>
		<dc:creator>rx</dc:creator>
		<pubDate>Mon, 28 May 2007 22:34:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/playing-with-blocks-part-1/#comment-227</guid>
		<description>your second example, given as 

&gt; 1. my_block = Proc.new {&#124;item&#124; puts item}
&gt; 2. the_array.each(my_block)

would fail, right. fix that by adding a `&amp;&#039; to the call parameter:

2. the_array.each( &amp;my_block )
                                ^

using this syntax, you actually _can_ foist Proc objects on methods expecting only raw blocks.

...the pickaxe is your friend. ;-)</description>
		<content:encoded><![CDATA[<p>your second example, given as </p>
<p>&gt; 1. my_block = Proc.new {|item| puts item}<br />
&gt; 2. the_array.each(my_block)</p>
<p>would fail, right. fix that by adding a `&amp;&#8217; to the call parameter:</p>
<p>2. the_array.each( &amp;my_block )<br />
                                ^</p>
<p>using this syntax, you actually _can_ foist Proc objects on methods expecting only raw blocks.</p>
<p>&#8230;the pickaxe is your friend. ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

