 
 
 (defn match? [actual expected looseness]
-  (let [comparison (compare-results (midje-classification actual) actual expected looseness)]
+  (let [comparison (compare-results  actual expected looseness)]
     (or (total-match? comparison)
         (apply noted-falsehood
                (cons (best-actual-match (midje-classification actual) comparison)

          (recur (rest expected-permutations)
                 (better-of comparison best-so-far)))))))

(defmethod compare-results ::map [midje-classification actual expected looseness]
  (order-free-compare-results expected 
                              (feasible-permutations (keys expected))
                              (fn [permutation]
                                (compare-one-map-permutation midje-classification
                                                             actual
                                                             expected
                                                             permutation))))

(defmethod compare-results [::not-map :in-any-order]
  [midje-classification actual expected looseness]
  (order-free-compare-results expected 
                              (feasible-permutations expected)
                              (fn [permutation]
                                (compare-one-seq-permutation midje-classification
                                                             actual
                                                             permutation
                                                             looseness))))

(defmethod compare-results [::not-map :strict-order]
  [midje-classification actual expected looseness]
  (let [starting-candidate (base-starting-candidate expected)
        gaps-ok? (some #{:gaps-ok} looseness)]


;;-

(defmulti compare-results
  (fn [actual expected looseness]
    (if (= ::map (midje-classification actual))
      midje-classification
      [::not-map (or (some #{:in-any-order} looseness) :strict-order)])))

