title: Clojure: Using filter with a function that has more than one parameter
body: <p>I'm trying to find all values within a collection that start with one letter. Filter seems to be the quickest way to do that. But I'm having trouble getting it to work with two parameters.</p>
  
  <p>This is the function</p>
  
  <pre><code>(defn starts [letter word]
    (def startVal (clojure.string/starts-with? word letter)
    startVal)
  </code></pre>
  
  <p>That's fine. It's trying to use filter on that that's the problem. I need to be able to try more than one letter, so I can't just hard-code it into the function here. But filter always throws errors (wrong arity (3) when I try to feed it more than one value. </p>
  
  <p>When I change starts into a one parameter function (I pass just the word and then I hardcode in a letter) and try </p>
  
  <pre><code>(println (filter starts [this is my example collection of words])
  </code></pre>
  
  <p>It works and I get the right value. </p>
  
  <p>How do I get filter to use two values. would it be doable via anonymous function written right into the filter call? </p>
  
  <p>If I'm going about this all wrong and could just code it another way I'd be happy to know too, but I would like to figure out how to use filter this way, if there is a solution.</p>