 (def *leaf-cutoff-length* 64) ; This value has been determined optimal for split operations through benchmarking. TODO make constant in clojure 1.3
 
 (defprotocol Measurable
-  "Trivial protocol for things measurable.
+  "Trivial protocol for things measurable
+
 Default implementations are provided for nil and String; nil measures as 0
 characters, 0 lines. Strings get analyzed accordingly."
   (measure [object] "Measure object"))

  (apply str (->> (rope-seq root) (filter string?))))

(defn rebalance
  "Create rebalanced copy of the Rope, using the algorithm described in \"Ropes: an Alternative to Strings\".
The implementation does not resemble the one from the paper, but is instead
idiomatic Clojure and optimized for functional languages in general."  [root]
  (let [fold (fn [coll] (reduce rope (reverse coll)))

  (print-simple (format "#<CharSequenceMeasurement %d/%d>" (:length weight) (:lines weight)) writer))

(defn measurement
  "CharSequenceMeasurement from length and lines

(measurement) is 0/0"
  ([] (CharSequenceMeasurement. 0 0))
  ([length lines] (CharSequenceMeasurement. length lines)))

