title: How to bind variables in Clojure macros?
body: <p>I'm trying to write a macro that takes a vector of bindings and a function that can access these bindings. In the simplest form:</p>
  
  <pre><code>(defmacro f-with-binds [binds f]
    `(let [~@binds]
       ~f))
  </code></pre>
  
  <p>even though the above works:</p>
  
  <pre><code>(f-with-binds [n 123 m 456] (println n m)) ;; =&gt; 123 456
  </code></pre>
  
  <p>I am not happy with this because Cursive highlights <code>n</code> and <code>m</code> as undeclared variables which does not happen for macros like <code>for</code> and <code>let</code> . How can I improve my implementation?</p>
  
  <p>ps.: the real macro returns a transducer - bindings are the transducer's state and function is the transducer's step function</p>