         (aset seek-key moving-key-ix (.key this))
         (.maintain this))
   (up [this]
+      (assert (true? end?)) ;; ?
       (assert (> moving-key-ix 0))
       (aset seek-key moving-key-ix greatest)
       (set! moving-key-ix pinned-key-ix)

      join)))

;; tree view of a trie
(deftype Treeterator [iterator key ^:mutable key-ix ^:mutable end? key-len]
  Object
  (key [this]
       (when (false? end?)
         (aclone key)))
  (val [this]
       (when (false? end?)
         (.val iterator)))
  (walk-up [this]
           (loop []
             (when (false? end?)
               (if (.-end? iterator)
                 (if (<= key-ix 0)
                   (set! end? true)
                   (do
                     (set! key-ix (- key-ix 1))
                     (.up iterator)
                     (recur)))))))
  (walk-down [this]
             (loop []
               (when (and (false? end?) (< key-ix (- (alength key) 1)))
                 (do
                   (set! key-ix (+ key-ix 1))
                   (.down iterator)
                   (aset key key-ix (.key iterator))))))
  (next [this]
        (.walk-up this)
        (when (false? end?)
          (.next iterator)
          (if (false? (.-end? iterator))
            (aset key key-ix (.key iterator))
            (set! end? true)))
        (.walk-down this))
  (seek [this key]
        (assert false "TODO")))


  ;; cljs.core.pr_str(cemerick.double_check.quick_check(1000, aurora.btree.iterator_prop)
  (dc/quick-check 5000 (intersection-prop 1))
  ;; cljs.core.pr_str(cemerick.double_check.quick_check(1000, aurora.btree.intersection_prop))
  (dc/quick-check 1000 (trie-tree-prop 1))
  (dc/quick-check 1000 (trie-tree-prop 2))


  (defn f []
