 
 ;; iteration
 
-(defn ^number -next-path [node
-                          ^number path
-                          ^number level]
+(defn -next-path [node path level]
   (let [idx (path-get path level)]
     (if (pos? level)
       ;; inner node

      idx
      -1)))

(defn ^number lookup-range [^array arr key]
  (let [arr-l (alength arr)
        idx   (binary-search arr 0 (dec arr-l) key)]
    (if (== idx arr-l)
      -1
      idx)))

(defn ^number lookup-insert-leaf [^array arr key]
  (binary-search arr 0 (- (alength arr) 1) key))

(defn ^number lookup-insert-node [^array arr key]
  (binary-search arr 0 (- (alength arr) 2) key))

(defn ^number -seek [set key]
  (loop [node  (.-root set)
         path  empty-path
         level (.-shift set)]

               (path-set path level idx)
               (- level level-shift))))))

(defn seek [set key]
  (binding [*cmp* (.-comparator set)]
    (-seek set key)))

;; Array operations

(defn cut-n-splice [arr cut-from cut-to splice-from splice-to xs]
  (let [arr-l   (alength arr)
        xs-l    (alength xs)
        l1      (- splice-from cut-from)
