<?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: Clojure: A first look at recursive functions</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/11/17/clojure-a-first-look-at-recursive-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/11/17/clojure-a-first-look-at-recursive-functions/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Tue, 09 Mar 2010 23:57:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tweets that mention Clojure: A first look at recursive functions at Mark Needham -- Topsy.com</title>
		<link>http://www.markhneedham.com/blog/2009/11/17/clojure-a-first-look-at-recursive-functions/comment-page-1/#comment-26896</link>
		<dc:creator>Tweets that mention Clojure: A first look at recursive functions at Mark Needham -- Topsy.com</dc:creator>
		<pubDate>Wed, 18 Nov 2009 09:48:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1836#comment-26896</guid>
		<description>[...] This post was mentioned on Twitter by Mark Needham, ajlopez. ajlopez said: RT @markhneedham: first thoughts on clojure recur - http://bit.ly/3O2lRZ [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Mark Needham, ajlopez. ajlopez said: RT @markhneedham: first thoughts on clojure recur &#8211; <a href="http://bit.ly/3O2lRZ" rel="nofollow">http://bit.ly/3O2lRZ</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/11/17/clojure-a-first-look-at-recursive-functions/comment-page-1/#comment-26862</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Tue, 17 Nov 2009 14:09:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1836#comment-26862</guid>
		<description>Thanks, I didn&#039;t know about defn not being defined in the local scope so I won&#039;t be doing that anymore!</description>
		<content:encoded><![CDATA[<p>Thanks, I didn't know about defn not being defined in the local scope so I won't be doing that anymore!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Sofra</title>
		<link>http://www.markhneedham.com/blog/2009/11/17/clojure-a-first-look-at-recursive-functions/comment-page-1/#comment-26844</link>
		<dc:creator>James Sofra</dc:creator>
		<pubDate>Tue, 17 Nov 2009 02:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1836#comment-26844</guid>
		<description>Your last example using the arity overload is actually the most idiomatic. Nesting a named function using defn is not idiomatic at all and is discouraged since it is not really defined in the local scope as you may expect, you could use letfn to achieve the same thing. Otherwise you could also use loop as a recur target which works quite nicely, so it may look like this:

(defn count-down [from]
  (loop [so-far [] down-from from]
    (if (zero? down-from)
      so-far
      (recur (conj so-far down-from) (dec down-from)))))

Cheers,
James</description>
		<content:encoded><![CDATA[<p>Your last example using the arity overload is actually the most idiomatic. Nesting a named function using defn is not idiomatic at all and is discouraged since it is not really defined in the local scope as you may expect, you could use letfn to achieve the same thing. Otherwise you could also use loop as a recur target which works quite nicely, so it may look like this:</p>
<p>(defn count-down [from]<br />
  (loop [so-far [] down-from from]<br />
    (if (zero? down-from)<br />
      so-far<br />
      (recur (conj so-far down-from) (dec down-from)))))</p>
<p>Cheers,<br />
James</p>
]]></content:encoded>
	</item>
</channel>
</rss>
