<?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: On Lisp -&gt; Clojure (chapter 2)</title>
	<atom:link href="http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/</link>
	<description>λ λ λ</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:17:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sidhant Godiwala</title>
		<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/comment-page-1/#comment-12233</link>
		<dc:creator>Sidhant Godiwala</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthvssoup.com/?p=914#comment-12233</guid>
		<description>&lt;p&gt;Thanks for the link, I&#039;ve just posted my version of the same chapter and I checked with yours to see what the differences are.&lt;/p&gt;

&lt;p&gt;Its really nice to have someone else to compare with and learn from :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the link, I&#8217;ve just posted my version of the same chapter and I checked with yours to see what the differences are.</p>

<p>Its really nice to have someone else to compare with and learn from :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin Sinclair</title>
		<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/comment-page-1/#comment-631</link>
		<dc:creator>Gavin Sinclair</dc:creator>
		<pubDate>Tue, 13 Jan 2009 15:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthvssoup.com/?p=914#comment-631</guid>
		<description>&lt;p&gt;Nice work.  Looking forward to reading the other installments.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nice work.  Looking forward to reading the other installments.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: fogus</title>
		<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/comment-page-1/#comment-167</link>
		<dc:creator>fogus</dc:creator>
		<pubDate>Wed, 01 Oct 2008 19:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthvssoup.com/?p=914#comment-167</guid>
		<description>&lt;p&gt;Dan,
Thanks for the explanation.  I had actually forgotten to go back and L@@k the reason, you saved me some work.  ;)&lt;/p&gt;

&lt;p&gt;-m&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dan,
Thanks for the explanation.  I had actually forgotten to go back and L@@k the reason, you saved me some work.  ;)</p>

<p>-m</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/comment-page-1/#comment-166</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 01 Oct 2008 19:36:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthvssoup.com/?p=914#comment-166</guid>
		<description>&lt;p&gt;The reason (sort &lt; &#039;(1 2 3 4 5)) fails is because the &lt; function returns a boolean, not 0, -1 or 1.  So if you create a function that follows that requirement:&lt;/p&gt;

&lt;p&gt;&lt;pre lang=&quot;lisp&quot;&gt;
(defn compare-count [x y]
    (let [x-count (count x) y-count (count y)]
        (cond (&gt; x-count y-count) 1
              (&gt; y-count x-count) -1
              (= x-count y-count) 0)))&lt;/p&gt;

&lt;p&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;then you can use it with sort:&lt;/p&gt;

&lt;p&gt;user=&gt; (sort compare-count &#039;([2 2] [5 5 5 5 5] [4 4 4 4] [1] [3 3 3]))
([1] [2 2] [3 3 3] [4 4 4 4] [5 5 5 5 5])&lt;/p&gt;

&lt;p&gt;P.S. Hope my formatting comes out okay.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The reason (sort &lt; &#8216;(1 2 3 4 5)) fails is because the &lt; function returns a boolean, not 0, -1 or 1.  So if you create a function that follows that requirement:</p>

<p><pre lang="lisp">
(defn compare-count [x y]
    (let [x-count (count x) y-count (count y)]
        (cond (&gt; x-count y-count) 1
              (&gt; y-count x-count) -1
              (= x-count y-count) 0)))</pre></p>

<p></p>

<p>then you can use it with sort:</p>

<p>user=&gt; (sort compare-count &#8216;([2 2] [5 5 5 5 5] [4 4 4 4] [1] [3 3 3]))
([1] [2 2] [3 3 3] [4 4 4 4] [5 5 5 5 5])</p>

<p>P.S. Hope my formatting comes out okay.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: fogus</title>
		<link>http://blog.fogus.me/2008/09/26/on-lisp-clojure-chapter-2/comment-page-1/#comment-143</link>
		<dc:creator>fogus</dc:creator>
		<pubDate>Tue, 30 Sep 2008 14:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthvssoup.com/?p=914#comment-143</guid>
		<description>&lt;p&gt;Excellent post!  Far from being discouraged, I am enthusiastic by your recommendations.  I am far less interested in being correct than in doing it correctly (if that makes any sense at all).&lt;/p&gt;

&lt;p&gt;I was a little discouraged that my implementation of remove-if was &#039;dangerous&#039; to the stack, and I delighted in your pointers in shoring that up.  Thank you.  It&#039;s clear that I need to study &lt;code&gt;recur&lt;/code&gt; more closely.&lt;/p&gt;

&lt;p&gt;I am sure that, at least in the early stages, I will make an abomination of the Clojure idioms, but I hope that over time they will become a part of my lexicon.&lt;/p&gt;

&lt;p&gt;My initial versions of the the closed counter and make-adderb attempted to use refs, but I couldn&#039;t quite get it to work.  I will use your advice and attempt to re-implement them, but will most likely keep the old hack laying around as a counter-example/don&#039;t-do-this case.&lt;/p&gt;

&lt;p&gt;Again, thank you for the tips for this Clojure n00b.
-m&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Excellent post!  Far from being discouraged, I am enthusiastic by your recommendations.  I am far less interested in being correct than in doing it correctly (if that makes any sense at all).</p>

<p>I was a little discouraged that my implementation of remove-if was &#8216;dangerous&#8217; to the stack, and I delighted in your pointers in shoring that up.  Thank you.  It&#8217;s clear that I need to study <code>recur</code> more closely.</p>

<p>I am sure that, at least in the early stages, I will make an abomination of the Clojure idioms, but I hope that over time they will become a part of my lexicon.</p>

<p>My initial versions of the the closed counter and make-adderb attempted to use refs, but I couldn&#8217;t quite get it to work.  I will use your advice and attempt to re-implement them, but will most likely keep the old hack laying around as a counter-example/don&#8217;t-do-this case.</p>

<p>Again, thank you for the tips for this Clojure n00b.
-m</p>]]></content:encoded>
	</item>
</channel>
</rss>

