Ahh, you're right, thats a typo and it should read person-map.

{:sex 0} is a map of keys removed. The reason I'm not using a set here is 
because I need to know the type of the datastructure to diff, and because 
it needs to work for nesting. For instance, this should also work.

(diff {:name "Robin", :friends {:school #{"Lars" "Jens" "Erika"}}}) {:name 
"Robin", :friends {:home #{"Mom"}, :school #{"Lars"}}})

Should return

[{:friends {:home #{"Mom"}}}
 {:friends {:school #{"Jens", "Erika"}}}]

What I said about retaining type information becomes especially relevant 
when it comes to list/seq/vector, as all those structures support the same 
operations, but the result of patch should return the correct type.

kl. 07:42:30 UTC+1 tirsdag 18. november 2014 skrev Atamert Ölçgen følgende:
>
> Hi Robin,
>
> Thanks for adding a README. It might contain a couple of errors though.
>
> I can't make sense of this for example:
>
> (def person-map {:name "Robin"
>                  :age 25
>                  :sex :male})
>
> (def person-diff (differ/diff test-map {:name "Robin Heggelund Hansen"
>                                         :age 26})
> ;; person-diff will now be [{:name "Robin Heggelund Hansen", :age 26};;       
>                    {:sex 0}]
>
>
> Where did test-map come from? I'm assuming it's person-map. Why is :sex 0? 
> Is he fat and bald? If that's a list of keys that's removed, I suggest 
> using a set there.
>
> (differ/patch {:specie :dog
>                :sex :female}
>               person-diff)
> ;; Will return {:name "Robin Heggelund Hansen";;              :age 26;;       
>        :specie :dog}
>
>
> Shouldn't the result contain [:sex :female] as well?
>
>
> On Tue, Nov 18, 2014 at 3:51 AM, Robin Heggelund Hansen <
> skinn...@gmail.com <javascript:>> wrote:
>
>> https://github.com/Skinney/differ
>>
>> I needed a way to send diffs of data from a cljs web-app to a clj 
>> backend, and I found clojure.data/diff to be a pain to work with, so i 
>> created my own solution. It currently only supports maps (and nested 
>> maps...), but support for lists, vectors and sets is on the roadmap for the 
>> next version. This version is mostly for me to test with my own app, which 
>> currently only uses maps.
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Kind Regards,
> Atamert Ölçgen
>
> -+-
> --+
> +++
>
> www.muhuk.com
>  

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to