title: clojure macro expand repeated code
body: <p>I am stuck trying to do something probably basic with clojure macro. I simplified my example to the minimal below. Let's say I have:</p>
  
  <pre><code>(def a {:i 0})
  </code></pre>
  
  <p>And I want to define b to something like:</p>
  
  <pre><code>(def b (my-func a a a a a a ... a a a a))
  </code></pre>
  
  <p>At compile time, I know how many <code>a</code> I want (for example 3). But to remove code redundancy, and for better code, I would like to parameterize the number of <code>a</code>. I would like something like:</p>
  
  <pre><code>(def b (my-func (some-magic-macro 3 a)))
  </code></pre>
  
  <p>that would expand to</p>
  
  <pre><code>(def b (my-func a a a))
  </code></pre>
  
  <p>Tried a bunch of things with macrodef, repeat, quoting etc... without much succes due to my limited understanding of clojure at this stage</p>
  
  <p>Thank you people!</p>