title: How to build data structure using nested calls to `map`
body: <p>I want to build a sequence of maps (the data structure) using nested calls to map (the function). Here's what I'm doing</p>
  
  <pre><code>(defn point [x y]
    {:x-coord x
     :y-coord y})
  
  (defn grid [rows columns]
    (mapcat 
      (fn [x] map
                (fn [y] (point x y))
                (range columns))
      (range rows)))
  </code></pre>
  
  <p>Which compiles fine, but doesn't work as I would expect. I expected that a call to grid would result in a sequence of maps:</p>
  
  <pre><code>user=&gt;(grid 2 2)
  ({:x-coord 0, :y-coord 0} {:x-coord 0, :y-coord 1} {:x-coord 1, :y-coord 0} {:x-coord 1, :y-coord 1})
  </code></pre>
  
  <p>But what I actually got was a sequence of ints:</p>
  
  <pre><code>user=&gt; (grid 2 2)
  (0 1 0 1)
  </code></pre>
  
  <p>So my question is, how can I get the sequence I want? and, why did I get the particular sequence I got?</p>