 (defprotocol IOperation
   (affects-key [op] "Which key this affects--currently must be a single key")
   (apply-op [op tree] "Applies the operation to the tree"))
-
-(declare insert delete)
 
 (defrecord InsertOp [key]
   IOperation

                 (recur children (conj rebuilt-children new-child) extra-msgs)))))))))

(defn insert
  (tree key)
  (enqueue tree [(->InsertOp key)]))

(clojure.pprint/pprint
  (-> (apply core/b-tree (range 30))

                     [(subvec msgs 0 negative-binsearch-result) ;not found, exclusive
                      (subvec msgs negative-binsearch-result)]
                     [(subvec msgs 0 (inc binsearch-result)) ;found, inclusive
                      (subvec msgs (inc binsearch-result))])

                   on-the-last-child? (empty? children)

