title: Remove nil values from a map?
body: <p>I have a Clojure map that may contain values that are nil and I'm trying to write a function to remove them, without much success (I'm new to this).</p>
  
  <p>E.g.:</p>
  
  <pre><code>(def record {:a 1 :b 2 :c nil})
  (merge (for [[k v] record :when (not (nil? v))] {k v}))
  </code></pre>
  
  <p>This results in a sequence of maps, which isn't what I expected from merge:</p>
  
  <pre><code>({:a 1} {:b 2})
  </code></pre>
  
  <p>I would like to have:</p>
  
  <pre><code>{:a 1, :b 2}
  </code></pre>