   (maintain [this]
             (set! end? (.-end? (aget key-ix->intersection key-ix))))
   (next [this]
-        (when (false? end)
+        (when (false? end?)
           (.next (aget key-ix->intersection key-ix))
           (.maintain this)))
   (seek [this key]
-        (when (false? end)
+        (when (false? end?)
           (.seek (aget key-ix->intersection key-ix) key)
           (.maintain this)))
   (down [this]

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

(defn iterator [tree]

        (assert false "TODO")))

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

