 		(partition 2 deriv-seq))
 	h))))
 
-
-
-
 (defn- reset-cache
   [method-cache method-table cached-hierarchy hierarchy]
   (swap! method-cache (fn [_] (deref method-table)))

      (throw (str "Preference conflict in multimethod '" name "': " dispatch-val-y " is already preferred to " dispatch-val-x)))
    (swap! prefer-table assoc dispatch-val-y (conj (get @prefer-table dispatch-val-x #{}) dispatch-val-y))
    (reset-cache method-cache method-table cached-hierarchy hierarchy))
  
  (-invoke [mf arg1]
    (let [dispatch-val (dispatch-fn arg1)
	  target-fn (-get-method mf dispatch-val)]
      (when-not target-fn
      	(throw (str "No method in multimethod '" name "' for dispatch value: " dispatch-val)))
      (prn target-fn arg1)
      (target-fn arg1)
      ))
  )






;; FF multimethods
(defn not-empty
  "If coll is empty, returns nil, else coll"
  [coll] (when (seq coll) coll))
