Do you know any lib for making diff from nested structures?
(diff [ 1 2 3 { 2 3 4 [ 1 2 { 1 2 3 4} ] } #{ 4 5 } ] [ 1 3 { 2 3 4 [ 1 4 {
2 2 3 5} ] } #{ 4 5 } ] )
-> [ 2 { [ 2 { 1 2 3 4 } ] } ]
as you can see it behaves like clojure.set/difference
and better if you would point the keys in map to keep remaining
(diff [ 1 2 3 { 2 3 4 [ 1 2 { 1 2 3 4 :tag "me" } ] } #{ 4 5 } ] [ 1 3 { 2
3 4 [ 1 4 { 2 2 3 5 :tag "me" } ] } #{ 4 5 } ] :keep [ :tag ] )
-> [ 2 { [ 2 { 1 2 3 4 :tag "me" } ] } ]
This tool would allow to compare XML documents in form got from reading them
by clojure.xml lib.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en