RLE-like string compression in clojure
Whenever you're splitting a list up into a number of chunks, it's worth looking into the partition function (and related functions).

A string is just a list of characters, and you just want to split it when the character changes, so (partition-by identity characters) should be much simpler than what you have above.  You can pair that with another partition to make sure you have no chunks of > 9 characters:

(defn rle-chunks [string]
  (-&gt;&gt; string
       (partition-by identity)
       (mapcat #(partition-all 9 %))))


Actually performing the compression is then just a case of calling first &amp; count on each of these chunks, then converting back to a string:

(defn rle [input]
  (-&gt;&gt; input
       rle-chunks
       (map (juxt first count))
       (apply concat)
       (apply str)))