title: Clojure: Why does if-let only allow 2 forms in the binding vector?
body: <p>When I use if-let like</p>
  
  <pre><code>(if-let [a 2 b nil] (+ a b))
  </code></pre>
  
  <p>I get an IllegalArgumentException:</p>
  
  <pre><code>clojure.core/if-let requires exactly 2 forms in binding vector...
  </code></pre>
  
  <p>Similar for when-let...</p>
  
  <p>This is not what I would expect. If-let could try all bindings and break when one fails and evaluate the else expression.</p>
  
  <p>The same complaint can be found in the comments at <a href="http://clojuredocs.org/clojure_core/clojure.core/if-let" rel="nofollow noreferrer">clojuredocs</a>. I found an answer <a href="https://stackoverflow.com/questions/11676120/why-dont-when-let-and-if-let-support-multiple-bindings-by-default">here</a> which did not really satisfy since the poster seems to have the equivalent of a nested if-let-structure in mind.</p>
  
  <p>What reasons are there to limit the bindings of the *-let macros?</p>
  
  <p>UPDATE:
  As it seems to be unclear, what my expectations of if-let are:</p>
  
  <ul>
  <li>It should evaluate all bindings sequentially. </li>
  <li>When all succeed, it should evaluate the 'then'-case. </li>
  <li>If one binding fails it should immediately break and evaluate the 'else'-case.</li>
  <li>In case of failure the bindings, even succeeded ones, should not be available in the 'else'-expression</li>
  </ul>