                     "There are several equally long paths to promote value"
                     {:value x
                      :paths (for [c candidates]
-                              (let [c (persistent! c)]
-                                (conj (mapv first c)
-                                      arg-spec)))})))))))
+                              (conj (mapv first c)
+                                    arg-spec))})))))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

          value x]
     (if (empty? promotion-path)
       value
       (let [[[k promoter] & r] promotion-path
             _ (assert (or (not check?)
                           (matches-arg-spec? k value)))
             next-value (promoter value)]




(defn evaluate-path-cost [path]
  (transduce
   (map :cost)
   +
   0.0
   path))

(defn- shortest-path [dst b]
  (if (empty? dst)
    [b]
    (let [dst-cost (evaluate-path-cost (first dst))
          b-cost (evaluate-path-cost b)]
      (cond
        (= dst-cost b-cost) (conj dst b)
        (< dst-cost b-cost) dst
        :default [b]))))


(defn- promotion-path-sub [visited arg-spec x]
  (cond
    (contains? visited arg-spec) nil
    (matches-arg-spec? arg-spec x) []
    :default
    (do
      (let [visited (conj visited arg-spec)
