<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged destructuring clojure.core if-let</title>
<link>https://ask.clojure.org/index.php/tag/destructuring+clojure.core+if-let</link>
<description></description>
<item>
<title>Associative destructuring with if-let</title>
<link>https://ask.clojure.org/index.php/14574/associative-destructuring-with-if-let</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm surprised by the result of this code :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if-let [{errors :errors} {}]
    errors
    true) =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I would have expected the result to be 'true'.&lt;/p&gt;
&lt;p&gt;As indicated by the result, 'errors' evaluates to nil, but still it's the 'then' arm of the 'if' that is evaluated.&lt;/p&gt;
&lt;p&gt;The guide on destructuring state that &quot;You can utilize destructuring anywhere that there is an explicit or implicit let binding.&quot;, so I'm a bit puzzled.&lt;/p&gt;
&lt;p&gt;Please, enlighten me. Thanks !&lt;/p&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14574/associative-destructuring-with-if-let</guid>
<pubDate>Sat, 07 Jun 2025 17:21:45 +0000</pubDate>
</item>
</channel>
</rss>