Have to be done more like this in Clojure:
(defn decode
[bits tree]
(loop [my-bits bits
current-branch tree
decoded-seq []]
(if (not (seq my-bits))
decoded-seq
(let [next-branch (choose-branch (first my-bits) current-branch)]
(if (leaf? next-branch)
(recur (rest my-bits) tree (conj decoded-seq (symbol-leaf next-branch)))
(recur (rest my-bits) next-branch decoded-seq))))))
How is that working? Do you guys lament the lack of TCO in Clojure? Personally, I find the lack of TCO in Clojure requires a different mindset than what you bring to a Scheme. And I'm not sure it's all good. Not to mention that my version of decode up there is single threaded, where outwardly the Scheme version appears as though it could run on multiple cores.
Thanks for offering to talk! I'm very excited about it.
-Nick