 (ns com.billpiel.mem-tracer.util.tree-query
-  (require [clojure.zip :as z]))
+  (require [clojure.zip :as z]
+           [swiss.arrows :refer [-<> -<>>]]))
 
 (def ^:dynamic *get-tags-mz* nil)
 

   node
   pred-map))

(defn get-children-tags
  [zipr]
  (let [kids (children-zips zipr)]
    (apply concat (for [child-zip kids
                        desc-tags (get-children-tags child-zip)]
                    (map (fn [tag-trail] (conj tag-trail (get-tags' child-zip))))))))

(defn tag*
  [zipr pred-map & {:keys [parent-tags]}]


#_ (do

     (def tree {:id 1 :children
                [{:id 2}
                 {:id 3
                  :children [{:id 5
                              :children [{:id 6}]}]}
                 {:id 4
                  :children [{:id 7
                              :children []}
                             {:id 8
                              :children []}
                             ]}]})

     [[[:a :even]]
      [[:a] [] [:even]]
      [[:a :even] []]
      [[:a :even] [:even]]]



     (def ppcp puget.printer/cprint)

     (ppcp tree)

     (def z1 (z/zipper map?
                       #(-> % :children not-empty)
                       #(assoc % :children %2)
                       tree))

     (ppcp (z/root z1))



