Skip to content

Instantly share code, notes, and snippets.

@pesterhazy
Created February 13, 2015 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pesterhazy/d1737549272109f79ea9 to your computer and use it in GitHub Desktop.
Save pesterhazy/d1737549272109f79ea9 to your computer and use it in GitHub Desktop.
Debugging aid: show differences between two data structures
(defn =* [a b]
(if (= a b)
true
(do
(println "No match:" a b)
(println "Dfference:" )
(clojure.pprint/pprint (clojure.data/diff a b))
false)))
@pesterhazy
Copy link
Author

The output as describe in the docstring (https://clojuredocs.org/clojure.data/diff) is:

[things-only-in-a things-only-in-b things-in-both]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment