          (.reset iterator)))
 
 (defn trieterator [iterator]
-  (Trieterator. iterator (least-key (.-key-len iterator)) nil -1 0 (.-end? it) (.-key-len iterator)))
+  (Trieterator. iterator (least-key (.-key-len iterator)) nil -1 0 (.-end? iterator) (.-key-len iterator)))
 
 ;; works on trees
 (deftype Intersection [iterators ^:mutable end? key-len]

        (assert false "TODO")))

(defn treeterator [iterator]
  (let [treeterator (Treeterator. iterator (least-key (.-key-len iterator)) 0 (.-key-len iterator))]
    (.walk-down treeterator)
    treeterator))


  (reset [this]
         (assert (> (alength marked-nodes) 0))
         (assert (> (alength marked-ixes) 0))
         (set! node (.pop marked-nodes))
         (set! ix (.pop marked-ixes))))

(defn iterator [tree]
