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



(defn match? [actual expected looseness]
  (let [comparison (compare-results (midje-classification actual) 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 [actual expected looseness]
  (order-free-compare-results expected 
                              (feasible-permutations (keys expected))
                              (fn [permutation]
                                (compare-one-map-permutation (midje-classification actual)
                                                             actual
                                                             expected
                                                             permutation))))

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

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

