 (defn- gen-visitor-from-pred-visitor-pairs
   [predicates+visitors inspect-node?]
   (fn predicate-table-visitor [node walker]
+    ;; this is becoming more and more like a dynamically created
+    ;; multimethod and should probably be converted into one
+    ;; In the simple case where only the current node is used for
+    ;; dispatch and not the walk history, this can be optimized into a
+    ;; dynamically created Protocol.
     (or (and (inspect-node? node)
-             (let [history-stack (:history walker)]
-               (some (fn sequential-pred-checker [[pred? visitor]]
-                       (if (pred? history-stack)
-                         (visitor node walker)))
-                   predicates+visitors)))
+             (some (fn sequential-pred-checker [[pred? visitor]]
+                     (if (pred? node walker)
+                       (visitor node walker)))
+                   predicates+visitors))
         node)))
 
 (defn normalize-selector-transformer-pairs [selectors+transformers]

;;; NOTE: all the dynamically created functions (from `fn`) in this
;;; module are given names to aid in debugging

(defn- span [p xs]
  ((juxt (partial take-while p)
         (partial drop-while p)) xs))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; For Maps it checks if the current node is a key of the
;; given map.
(extend clojure.lang.IPersistentMap NodeTransformer
        ;; for some reason interfaces have to be extended like this
        ;; rather than via extend-protocol
