title: Append to clojure vector from within loop
body: <p>I have:</p>
  
  <pre><code>(defn keep?
  
     (def sum [])
       (loop [i 0]
          (when (&lt; i 10)
             (conj sum 10)
             (recur (inc i))))
       sum
     )
  </code></pre>
  
  <p>This just gives me and empty vector even though I am conj-ing 10 onto sum. Is this because it is not in-scope within the Loop? How would I achieve the same outcome. (btw, this example is deliberately simplified)</p>
  
  <p>Thanks</p>