The project file I used ..

(defproject trybug "1.0.0-SNAPSHOT"



  :description "FIXME: write description"



  :dependencies [[org.clojure/clojure "1.3.0"]



                 [org.clojure/data.priority-map "0.0.1"]]



  :repositories {"sonatype-oss-public"



                 "https://oss.sonatype.org/content/groups/public/"})















Sunil.

On Fri, Dec 16, 2011 at 2:45 PM, Sunil S Nandihalli <
[email protected]> wrote:

> Hi,
>  The data.priority-map has been a nice library. I have used it quiet
> often. Recently, when I used it, I discovered the following unexpected
> behaviour.. can somebody throw some light on it?
>
> (-> (pm/priority-map-by #(> (count %1) (count %2)))
>
>
>
>     (update-in [1] #(assoc (or % {}) 2 3))
>
>
>
>     (update-in [2] #(assoc (or % {}) 1 3))
>
>
>
>     (update-in [2] #(assoc (or % {}) 2 4))
>
>
>
>     (update-in [1] #(assoc (or % {}) 3 4)))
>
> The answer I expected was
>
> {1 {2 3,3 4} , 2 {1 3, 2 4}}
>
> but the one I got was
>
> {1 {2 4, 1 3}, 2 {2 4, 1 3}}
>
> Is this the expected behaviour?.. am I using it wrong?
>
> Thanks,
> Sunil.
>
>

-- 
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

Reply via email to