Is there a nice way to print out differences in clojure data structures? In Perl for example there is Test::Differences which helps a lot.
Fanciest diff what I saw is deep-diff
It produces nice colorful diff like this

There also mention of nice editscript lib whick produce diff as array of patches.
Differ is a recent library that seems to do a nice job:
(def person-map {:name "Robin"
                 :age 25
                 :sex :male
                 :phone {:home 99999999
                         :work 12121212})
(def person-diff (differ/diff person-map {:name "Robin Heggelund Hansen"
                                          :age 26
                                          :phone {:home 99999999})
;; person-diff will now be [{:name "Robin Heggelund Hansen"
;;                           :age 26}
;;                          {:sex 0
;;                           :phone {:work 0}]
EDITED: fix Differ repo URL that change from gitlab to GitHub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With