title: Map vector of vectors to vector of hashes in Clojure
body: <p>I have a vector of points in 2D space such as:</p>
  
  <pre><code>[[0 0] [1 1] [2 2]]
  </code></pre>
  
  <p>And need to compute the distance between some point and each point in the vector to determine which point in the vector is closest to the point I'm querying. I need to know both the distance and the closest point, so I want a vector of hashes like this:</p>
  
  <pre><code>[{:point [0 0] :dist 2.7} {:point [1 1] :dist 3.5} {:point [2 2] :dist 4.3}]
  </code></pre>
  
  <p>How can I transform the former into the latter? I tried something like this:</p>
  
  <pre><code>(defn closest-point [point all-points]
      (map #({:point % :dist (distance point %)}) all-points))
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>(user=&gt; ArityException Wrong number of args (0) passed to: PersistentArrayMap  clojure.lang.AFn.throwArity (AFn.java:437)
  </code></pre>