title: Puzzled: Clojure for loop with :while -> unexpected behaviour?
body: <p>I've been learning Clojure and puzzled by the following:</p>
  
  <pre><code>user=&gt; (for [a (range 1 4) b (range 1 4)] [a b])
  ([1 1] [1 2] [1 3] [2 1] [2 2] [2 3] [3 1] [3 2] [3 3]); _no surprise here_
  </code></pre>
  
  <p>Let's add <code>:while (not= a b)</code>, I expect to see an empty list as the loop should stop if the condition is false. In this case it's the very first item where <code>a</code>=<code>b</code>=1. Let's see:</p>
  
  <pre><code>user=&gt; (for [a (range 1 4) b (range 1 4) :while (not= a b) ] [a b])
  
  ([2 1] [3 1] [3 2]) ; _surprise!_
  </code></pre>
  
  <p>Changing <code>:while</code> to <code>:when</code> to filter out <code>(= a b)</code> pairs</p>
  
  <pre><code>user=&gt; (for [a (range 1 4) b (range 1 4) :when (not= a b) ] [a b])
  ([1 2] [1 3] [2 1] [2 3] [3 1] [3 2]); _expected_
  </code></pre>
  
  <p>Could anyone explain why <code>(for [ ... :while ..] ...)</code> behaves like this?</p>
  
  <p>I'm using Clojure 1.3 on OS X.</p>
  
  <p>Thank you and apologize for the lack of formatting. This is my virgin post on StackOverflow.</p>