<?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: when-let macro</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17: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: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-124646</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Sat, 16 Jul 2011 10:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-124646</guid>
		<description>@mdeboard:disqus thanks for the feedback!

I was trying to use the language that I see used elsewhere to describe what I understand of the macro but as you point out that doesn&#039;t help!
In normal English the when-let macro will execute the second argument passed to it assuming that the value assigned to the value inside the [] is not nil.</description>
		<content:encoded><![CDATA[<p>@mdeboard:disqus thanks for the feedback!</p>
<p>I was trying to use the language that I see used elsewhere to describe what I understand of the macro but as you point out that doesn&#8217;t help!<br />
In normal English the when-let macro will execute the second argument passed to it assuming that the value assigned to the value inside the [] is not nil.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-124645</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sat, 16 Jul 2011 04:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-124645</guid>
		<description>&quot;‘when-let’ is used when we want to bind an expression to a symbol and only execute the body provided as the second argument to the macro if that symbol evaluates to true.&quot;
I really appreciate you taking the time to post this info but cloudy writing like this is endemic to posts about Clojure. Clojure experts (or at least people who can reliably program in Clojure, e.g. not me) seem to take great pleasure in obfuscating what they mean with bizarre sentence structure.

In other words: Huh?</description>
		<content:encoded><![CDATA[<p>&#8220;‘when-let’ is used when we want to bind an expression to a symbol and only execute the body provided as the second argument to the macro if that symbol evaluates to true.&#8221;<br />
I really appreciate you taking the time to post this info but cloudy writing like this is endemic to posts about Clojure. Clojure experts (or at least people who can reliably program in Clojure, e.g. not me) seem to take great pleasure in obfuscating what they mean with bizarre sentence structure.</p>
<p>In other words: Huh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Logan</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-28002</link>
		<dc:creator>Patrick Logan</dc:creator>
		<pubDate>Wed, 09 Dec 2009 03:19:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-28002</guid>
		<description>&quot;why don&#039;t you use destructuring for your argument list?&quot;

There&#039;s some code in the core lib that could be written more simply if the order of some functions and macros in that file were rearranged. I ran into that adding a...

(cond ...
         ( =&gt; fn)
        ...)

clause to the cond macro. I started puling things up toward the top of the file to make coding that more simple.

http://patrickdlogan.posterous.com/updated-clojure-cond-macro-with-test-value-ap

I&#039;ve since not used that kind of clause enough to propose it and all the rearranging of the core.</description>
		<content:encoded><![CDATA[<p>&#8220;why don&#8217;t you use destructuring for your argument list?&#8221;</p>
<p>There&#8217;s some code in the core lib that could be written more simply if the order of some functions and macros in that file were rearranged. I ran into that adding a&#8230;</p>
<p>(cond &#8230;<br />
         ( =&gt; fn)<br />
        &#8230;)</p>
<p>clause to the cond macro. I started puling things up toward the top of the file to make coding that more simple.</p>
<p><a href="http://patrickdlogan.posterous.com/updated-clojure-cond-macro-with-test-value-ap" rel="nofollow">http://patrickdlogan.posterous.com/updated-clojure-cond-macro-with-test-value-ap</a></p>
<p>I&#8217;ve since not used that kind of clause enough to propose it and all the rearranging of the core.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-27976</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Tue, 08 Dec 2009 18:16:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-27976</guid>
		<description>Ah, I dunno! I just copied that &#039;when-let&#039; macro out of the core library :-D</description>
		<content:encoded><![CDATA[<p>Ah, I dunno! I just copied that &#8216;when-let&#8217; macro out of the core library <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ola Bini</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-27975</link>
		<dc:creator>Ola Bini</dc:creator>
		<pubDate>Tue, 08 Dec 2009 17:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-27975</guid>
		<description>Just out of curiosity, why don&#039;t you use destructuring for your argument list? Then you can remove your assertions AND your extra bindings:


2
3
4
5
6
7
8
9
10
11
12
13
(defmacro when-let
  &quot;bindings =&gt; binding-form test
 
  When test is true, evaluates body with binding-form bound to the value of test&quot;
  [[form tst] &amp; body]
    `(let [temp# ~tst]
       (when temp#
         (let [~form temp#]
           ~@body))))</description>
		<content:encoded><![CDATA[<p>Just out of curiosity, why don&#8217;t you use destructuring for your argument list? Then you can remove your assertions AND your extra bindings:</p>
<p>2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
11<br />
12<br />
13<br />
(defmacro when-let<br />
  &#8220;bindings =&gt; binding-form test</p>
<p>  When test is true, evaluates body with binding-form bound to the value of test&#8221;<br />
  [[form tst] &amp; body]<br />
    `(let [temp# ~tst]<br />
       (when temp#<br />
         (let [~form temp#]<br />
           ~@body))))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Logan</title>
		<link>http://www.markhneedham.com/blog/2009/12/09/clojure-when-let-macro/comment-page-1/#comment-27971</link>
		<dc:creator>Patrick Logan</dc:creator>
		<pubDate>Tue, 08 Dec 2009 16:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1903#comment-27971</guid>
		<description>Line 12 is establishing the binding to the symbol used in the when&#039;s body, i.e. the symbol &#039;a in your example.

The symbol &#039;a is only bound to 2 *after* the test for 2 being a truthy value.</description>
		<content:encoded><![CDATA[<p>Line 12 is establishing the binding to the symbol used in the when&#8217;s body, i.e. the symbol &#8216;a in your example.</p>
<p>The symbol &#8216;a is only bound to 2 *after* the test for 2 being a truthy value.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

