<?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: Surveying Emacs Lisp</title>
	<atom:link href="http://items.sjbach.com/544/surveying-emacs-lisp/feed" rel="self" type="application/rss+xml" />
	<link>http://items.sjbach.com/544/surveying-emacs-lisp</link>
	<description></description>
	<lastBuildDate>Fri, 19 Feb 2010 12:11:08 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Charmain Panama</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-5666</link>
		<dc:creator>Charmain Panama</dc:creator>
		<pubDate>Thu, 04 Feb 2010 09:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-5666</guid>
		<description>There is evidently a lot for me to study outside of my books.  Thanks for the important read,</description>
		<content:encoded><![CDATA[<p>There is evidently a lot for me to study outside of my books.  Thanks for the important read,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: linkfeedr &#187; Blog Archive &#187; lisp - RSS Indexer (beta)</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2645</link>
		<dc:creator>linkfeedr &#187; Blog Archive &#187; lisp - RSS Indexer (beta)</dc:creator>
		<pubDate>Tue, 14 Apr 2009 19:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2645</guid>
		<description>[...] This article was found on emacs life. Click here to visit the full article on the original website. Surveying Emacs Lisp - A good article that looks at Emacs Lisp and a little Ruby.  ... more on the original website [...]</description>
		<content:encoded><![CDATA[<p>[...] This article was found on emacs life. Click here to visit the full article on the original website. Surveying Emacs Lisp &#8211; A good article that looks at Emacs Lisp and a little Ruby.  &#8230; more on the original website [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Bach</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2537</link>
		<dc:creator>Stephen Bach</dc:creator>
		<pubDate>Sat, 11 Apr 2009 17:13:52 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2537</guid>
		<description>Ryan, it&#039;s a little counterintuitive, but even with your change the function doesn&#039;t work exactly right.  Try this input to see:

&lt;pre lang=&quot;ruby&quot;&gt;
strings = &quot;a b c d e f g&quot;.split
column_count = 3
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Ryan, it&#8217;s a little counterintuitive, but even with your change the function doesn&#8217;t work exactly right.  Try this input to see:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">strings = <span style="color:#996600;">&quot;a b c d e f g&quot;</span>.<span style="color:#CC0066;">split</span>
column_count = <span style="color:#006666;">3</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Davis</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2527</link>
		<dc:creator>Ryan Davis</dc:creator>
		<pubDate>Sat, 11 Apr 2009 09:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2527</guid>
		<description>I&#039;d actually come up with this before reading the numerous comments. The only thing bitti needed was to calculate the number of rows and use that for each_slice.

&lt;pre lang=&quot;ruby&quot;&gt;
require &#039;enumerator&#039;

def new_columnize(strings, column_count)
  r = []
  rows = (strings.size / column_count.to_f).round
  strings.each_slice(rows) { &#124;a&#124; r &lt;&lt; a }
  r
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;d actually come up with this before reading the numerous comments. The only thing bitti needed was to calculate the number of rows and use that for each_slice.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066;">require</span> <span style="color:#996600;">'enumerator'</span>
&nbsp;
<span style="color:#9966CC;">def</span> new_columnize<span style="color:#006600; font-weight:bold;">&#40;</span>strings, column_count<span style="color:#006600; font-weight:bold;">&#41;</span>
  r = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  rows = <span style="color:#006600; font-weight:bold;">&#40;</span>strings.<span style="color:#9900CC;">size</span> <span style="color:#006600; font-weight:bold;">/</span> column_count.<span style="color:#9900CC;">to_f</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">round</span>
  strings.<span style="color:#9900CC;">each_slice</span><span style="color:#006600; font-weight:bold;">&#40;</span>rows<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>a<span style="color:#006600; font-weight:bold;">|</span> r <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> a <span style="color:#006600; font-weight:bold;">&#125;</span>
  r
<span style="color:#9966CC;">end</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Bach</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2454</link>
		<dc:creator>Stephen Bach</dc:creator>
		<pubDate>Fri, 03 Apr 2009 03:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2454</guid>
		<description>Fester, bitti, your versions of &lt;code&gt;columnize&lt;/code&gt; actually ensure there will be &lt;code&gt;column_count&lt;/code&gt; &lt;i&gt;rows&lt;/i&gt;, not columns.  Slightly different.</description>
		<content:encoded><![CDATA[<p>Fester, bitti, your versions of <code>columnize</code> actually ensure there will be <code>column_count</code> <i>rows</i>, not columns.  Slightly different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bitti</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2265</link>
		<dc:creator>bitti</dc:creator>
		<pubDate>Thu, 02 Apr 2009 18:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2265</guid>
		<description>Sorry, forgot the pre tag:

&lt;pre lang=&quot;ruby&quot;&gt;
def columnize(strings, column_count)
  cols = []
  strings.each_slice(column_count) { &#124;row&#124; cols &lt;&lt; row }
  cols
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sorry, forgot the pre tag:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC;">def</span> <span style="color:#007719;">columnize</span><span style="color:#006600; font-weight:bold;">&#40;</span>strings, column_count<span style="color:#006600; font-weight:bold;">&#41;</span>
  cols = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  strings.<span style="color:#9900CC;">each_slice</span><span style="color:#006600; font-weight:bold;">&#40;</span>column_count<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>row<span style="color:#006600; font-weight:bold;">|</span> cols <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> row <span style="color:#006600; font-weight:bold;">&#125;</span>
  cols
<span style="color:#9966CC;">end</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: bitti</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2264</link>
		<dc:creator>bitti</dc:creator>
		<pubDate>Thu, 02 Apr 2009 18:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2264</guid>
		<description>For columnize use each_slice:

def columnize(strings, column_count)
  cols = []
  strings.each_slice(column_count) { &#124;row&#124; cols &lt;&lt; row }
  cols
end</description>
		<content:encoded><![CDATA[<p>For columnize use each_slice:</p>
<p>def columnize(strings, column_count)<br />
  cols = []<br />
  strings.each_slice(column_count) { |row| cols &lt;&lt; row }<br />
  cols<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Bach</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2249</link>
		<dc:creator>Stephen Bach</dc:creator>
		<pubDate>Wed, 01 Apr 2009 17:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2249</guid>
		<description>A friend points out that because of Emacs Lisp&#039;s dynamic scope, the &lt;code&gt;lambda&lt;/code&gt; in my &lt;code&gt;columnize&lt;/code&gt; function is of uncertain correctness; if the implementation of &lt;code&gt;reduce&lt;/code&gt; happens to bind a variable named &lt;code&gt;nrows&lt;/code&gt;, the sky will fall.

None of the proposed rewrites show that mistake, so good for you folks.  :-)</description>
		<content:encoded><![CDATA[<p>A friend points out that because of Emacs Lisp&#8217;s dynamic scope, the <code>lambda</code> in my <code>columnize</code> function is of uncertain correctness; if the implementation of <code>reduce</code> happens to bind a variable named <code>nrows</code>, the sky will fall.</p>
<p>None of the proposed rewrites show that mistake, so good for you folks.  <img src='http://items.sjbach.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fester</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2245</link>
		<dc:creator>Fester</dc:creator>
		<pubDate>Wed, 01 Apr 2009 10:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2245</guid>
		<description>Maybe I am missing something from your version of columnize, but maybe you should consider this:
&lt;pre lang=&quot;ruby&quot;&gt;
def columnize(strings, columns)
  cols = []
  strings.each_slice(columns){&#124;x&#124; cols &lt;&lt; x}
  return cols
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Maybe I am missing something from your version of columnize, but maybe you should consider this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC;">def</span> <span style="color:#007719;">columnize</span><span style="color:#006600; font-weight:bold;">&#40;</span>strings, columns<span style="color:#006600; font-weight:bold;">&#41;</span>
  cols = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  strings.<span style="color:#9900CC;">each_slice</span><span style="color:#006600; font-weight:bold;">&#40;</span>columns<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> cols <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> x<span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#0000FF;">return</span> cols
<span style="color:#9966CC;">end</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-03-31 &#171; My Weblog</title>
		<link>http://items.sjbach.com/544/surveying-emacs-lisp/comment-page-1#comment-2242</link>
		<dc:creator>links for 2009-03-31 &#171; My Weblog</dc:creator>
		<pubDate>Wed, 01 Apr 2009 04:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://items.sjbach.com/?p=544#comment-2242</guid>
		<description>[...] Surveying Emacs Lisp - items.sjbach.com (tags: emacs) [...]</description>
		<content:encoded><![CDATA[<p>[...] Surveying Emacs Lisp &#8211; items.sjbach.com (tags: emacs) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
