<?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: Ruby Blocks and Blocks</title>
	<atom:link href="http://push.cx/2006/ruby-blocks-and-blocks/feed" rel="self" type="application/rss+xml" />
	<link>http://push.cx/2006/ruby-blocks-and-blocks</link>
	<description>A traveling geek&#039;s blog on development, games, and the web</description>
	<lastBuildDate>Tue, 17 Jan 2012 16:49:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Craftsmanship Tour: 8th Light - Push cx</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-117836</link>
		<dc:creator>Craftsmanship Tour: 8th Light - Push cx</dc:creator>
		<pubDate>Thu, 16 Dec 2010 17:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-117836</guid>
		<description>[...] are fewer variables and I moved their initialization together, so your eye picks up the parallel structure and just [...]</description>
		<content:encoded><![CDATA[<p>[...] are fewer variables and I moved their initialization together, so your eye picks up the parallel structure and just [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Harkins</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-981</link>
		<dc:creator>Peter Harkins</dc:creator>
		<pubDate>Fri, 23 Jun 2006 21:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-981</guid>
		<description>Thanks for the good references. I think pointfree expresses what I was thinking of, but I dig the proc version.</description>
		<content:encoded><![CDATA[<p>Thanks for the good references. I think pointfree expresses what I was thinking of, but I dig the proc version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adz</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-929</link>
		<dc:creator>Adz</dc:creator>
		<pubDate>Thu, 22 Jun 2006 14:13:23 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-929</guid>
		<description>Hmm, i think i missed your point though: &quot;it looks something like nested fuction calls.&quot; -- ! 
I like to think of it as chaining rather than nested - the way that the &#039;.&#039; evaluates from left to right.</description>
		<content:encoded><![CDATA[<p>Hmm, i think i missed your point though: &#8220;it looks something like nested fuction calls.&#8221; &#8212; !<br />
I like to think of it as chaining rather than nested &#8211; the way that the &#8216;.&#8217; evaluates from left to right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adz</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-928</link>
		<dc:creator>Adz</dc:creator>
		<pubDate>Thu, 22 Jun 2006 13:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-928</guid>
		<description>&quot;I’m compelled to write this as a block yielding to a block, though it doesn’t compile..&quot;

Seem&#039;s like you want to do &#039;something&#039; with the result of line.split which is again &#039;iterator&#039; like.   No?  

After all, it returns two values, which are used only in the next line.

How&#039;s about:
“3 4\n5 6\n7 8″.each do &#124;line&#124;
  print line.split.inject(0) { &#124;prev, a&#124; prev + Integer(a) }, &quot;&quot;
end

Although, along the lines you were thinking - you could do something like a &#039;nested function call&#039; using a proc object (like a python lambda):

“3 4\n5 6\n7 8″.each do &#124;line&#124;
   print proc {&#124;a,b&#124; Integer(a) + Integer(b) }.call(*line.split), &quot;&quot;
end

But i think inject is sweeter.</description>
		<content:encoded><![CDATA[<p>&#8220;I’m compelled to write this as a block yielding to a block, though it doesn’t compile..&#8221;</p>
<p>Seem&#8217;s like you want to do &#8216;something&#8217; with the result of line.split which is again &#8216;iterator&#8217; like.   No?  </p>
<p>After all, it returns two values, which are used only in the next line.</p>
<p>How&#8217;s about:<br />
“3 4\n5 6\n7 8″.each do |line|<br />
  print line.split.inject(0) { |prev, a| prev + Integer(a) }, &#8220;&#8221;<br />
end</p>
<p>Although, along the lines you were thinking &#8211; you could do something like a &#8216;nested function call&#8217; using a proc object (like a python lambda):</p>
<p>“3 4\n5 6\n7 8″.each do |line|<br />
   print proc {|a,b| Integer(a) + Integer(b) }.call(*line.split), &#8220;&#8221;<br />
end</p>
<p>But i think inject is sweeter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Bremner</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-164</link>
		<dc:creator>David Bremner</dc:creator>
		<pubDate>Sat, 29 Apr 2006 04:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-164</guid>
		<description>That looks like &lt;a href=&quot;http://www.haskell.org/haskellwiki/Pointfree&quot;&gt;pointfree style&lt;/a&gt;. The Common Lisp &lt;a href=&quot;http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node347.html#SECTION003400000000000000000&quot; &gt;Series&lt;/a&gt; library uses a similar design.</description>
		<content:encoded><![CDATA[<p>That looks like <a href="http://www.haskell.org/haskellwiki/Pointfree">pointfree style</a>. The Common Lisp <a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node347.html#SECTION003400000000000000000" >Series</a> library uses a similar design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Fein</title>
		<link>http://push.cx/2006/ruby-blocks-and-blocks/comment-page-1#comment-163</link>
		<dc:creator>Peter Fein</dc:creator>
		<pubDate>Sat, 29 Apr 2006 00:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://push.cx/2006/ruby-blocks-and-blocks#comment-163</guid>
		<description>Ruby&#039;s weird like that?

I find the book&#039;s approach pretty hard to read.</description>
		<content:encoded><![CDATA[<p>Ruby&#8217;s weird like that?</p>
<p>I find the book&#8217;s approach pretty hard to read.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

