          (finally (close-local-contexts contexts merged active))))))
 
 
+(defn- firsts [coll]
+  (vec (map first (partition 2 coll))))
+
+(defn- seconds [coll]
+  (vec (map second (partition 2 coll))))
+
 ;;; Public API
 
 (defmacro is

          (= (+ 8 -1) 7))
"
  [argv expr & values]
  (let [argc (count argv)
        sym (gensym "f")]
    (assert (vector? argv))
    (assert (zero? (rem (count values) argc)))
    `(let [~sym (fn ~argv ~expr)]
       (SimpleContainer ~(vec (map (fn [vs]
                                     `(SimpleAssertion
                                       (fn [] (~sym ~@vs))
                                       {:form '(are ~argv ~expr ~@vs)
                                        :file *file*
                                        :line ~(some #(:line (meta %)) vs)}
                                       nil))
                                   (partition argc values)))
                        {:generator 'are
                         :file *file*

  which will be compiled into a function.  A string will be attached
  as :doc metadata on the following assertion."
  [& assertions]
  (let [givens (vec (filter #(::given (meta %)) (keys &env)))]
    (loop [r [], as assertions]
      (if (seq as)
        (let [[doc form nxt] (if (string? (first as))
                               [(first as) (second as) (nnext as)]
                               [nil (first as) (next as)])
              metadata {:doc doc,
                        :form form
                        :file *file*
                        :line (:line (meta form))
                        :locals givens}]
          (recur (conj r (if (seq givens)
                           `(ContextualAssertion
                             ~givens (fn ~givens ~form)
                             '~metadata nil)
                           `(SimpleAssertion
                             (fn [] ~form) '~metadata nil)))
                 nxt))
        `(SimpleContainer ~r {:generator 'is
                              :line ~(:line (meta &form))
                              :file *file*
                              :form '~&form}
                          nil)))))

(defmacro thrown?
  "Returns true if body throws an instance of class c."
