title: Variable Arguments for Riemann project function
body: <p>So I am working on a stream function which will sum up some metrics for several events. To do this I use the <code>project</code> function and it looks something like this:</p>
  
  <pre><code>(project [(func (:service event) (nth service-list 0))      
            (func (:service event) (nth service-list 1))
            (func (:service event) (nth service-list 2))]
           (..))
  </code></pre>
  
  <p><code>service-list</code> is a argument of the surrounding function, which contain a vector of services that must be added together. <code>func</code> is a function that takes two arguments and returns a <code>true</code>/<code>false</code> Using the above snippet works fine, but I would like to be able to simplify it so that a vector that is larger or smaller than 3 elements would work.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>    (project (mapv (fn[service] (
                     `func (:service event) ~service)
                     ) service-list)))
               (..)
  </code></pre>
  
  <p>which I think returns a vector of functions which are unevaluated. I went with this approach once I realised that <code>project</code> is a macro. No idea if I am doing the right thing...</p>