title: Clojure pattern matching for vectors
body: <p>I'd like to write a function that takes vectors [&amp; x] and applies a test to pairs of elements. Outputting a vector of elements the test deemed identical and a vector of nil elements. </p>
  
  <p>My first thought is to take the vectors and flatten them.</p>
  
  <pre><code>(defn soup [&amp; x]
      (vec (flatten x))
  </code></pre>
  
  <p>Then apply a test such as identical? neg? or something along those lines. It's at the point of pattern matching that I am stuck in trying to assemble the output. </p>
  
  <p>Ex)
  Input 1:  [:a :b :c :a :b :c]</p>
  
  <p>Output 1: [[:a :a] [:b :b] [:c :c]]</p>
  
  <p>Input 2:  [[:a :b :c] [:a :b :c]]</p>
  
  <p>Output 2: [[[:a :b :c] [:a :b :c]]]</p>
  
  <p>If Input 2 is first flattened, it gives back Output 1.</p>