spdiff implemented in clojure