 
 ;; The interface
 
-(defmacro- container-checker [name checker-fn]
-  `(with-meta
-     (fn [expected# & kind#]
-       (vary-meta
-         (named '~name expected#
-                (fn [actual#]
-                  ;; (prn "checking" actual# expected# kind#)
-                  (add-actual actual#
-			      (if (chatty-checker-falsehood?
-				   (compatibility-failure actual# expected# kind#))
-				(compatibility-failure actual# expected# kind#)
-				(try (~checker-fn actual# expected# kind#)
-				     (catch Error ex#
-				       (tag-as-chatty-falsehood {
-								 :notes [(.getMessage ex#)]}))))))
-		merge
-		{:midje/chatty-checker true, :midje/checker true}))
-       {:midje/checker true})))
-
-(def contains (container-checker contains
+(defn- container-checker-maker [name checker-fn]
+  (tag-as-checker
+   (fn [expected & kind]
+      (tag-as-chatty-checker
+       (named name expected
+              (fn [actual]
+                (add-actual actual
+                            (try (checker-fn actual expected kind)
+                                 (catch Error ex
+                                   (noted-falsehood (.getMessage ex)))))))))))
+
+(def contains (container-checker-maker 'contains
     (fn [actual expected kind]
       (let [ [actual expected kind] (standardized-arguments actual expected kind)]
         (cond (regex? expected)

                                 (cl-format nil " of size ~R." (count expected)))]}))))))

(def has-prefix
     (container-checker has-prefix
      (has-xfix "prefix" #(re-pattern (str "^" (.toString %))) take)))
(def has-suffix
     (container-checker has-suffix
      (has-xfix "suffix" #(re-pattern (str (.toString %) "$" )) take-last)))
                            
(defn has [quantifier predicate]

  [ [binding-var] [function & arglist] ]
  (let [result-symbol (gensym "chatty-intermediate-results-")
        [complex-forms substituted-arglist] (chatty-untease result-symbol arglist)]
    `(tag-as-chatty-checker
      (fn [~binding-var]
        (let [~result-symbol (vector ~@complex-forms)]
          (if (~function ~@substituted-arglist)
            true
            (let [pairs# (map vector '~complex-forms ~result-symbol)]
              (tag-as-chatty-falsehood {:actual ~binding-var,
                                        :intermediate-results pairs#}))))))))

;;Concerning Throwables
