Ah, for some reason, I had it in my head that the value found in the map was the *last* argument passed to the function.
This behavior makes a lot more sense now. Thanks for the clarification! On Thursday, May 29, 2014 11:00:58 AM UTC-6, Stuart Fehr wrote: > > I am not sure if this is considered a "bug" or if it is simply expected > behavior, so I thought I would ask the list for clarification. > > I have this test which passes and shows the strange behavior that I am > encountering: > > (deftest update-in-and-remove > ;; The leaf value becomes and empty list instead of [1 3] > (is (= {:mykey {:myotherkey '()}} > (update-in {:mykey {:myotherkey [1 2 3]}} [:mykey :myotherkey] > remove #{2}))) > ;; Forcing a vector results in the behavior that I would expect > (is (= {:mykey {:myotherkey [1 3]}} > (update-in {:mykey {:myotherkey [1 2 3]}} [:mykey :myotherkey] > (comp vec (partial remove #{2})))))) > > I think this behavior is due to the use of apply in the definition of > update-in and I think (but haven't tested) adding a partial to the > non-recursive clause will fix this: > > https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L5687 > > However, I don't want to submit a "fix" if this is the expected behavior. > Thoughts? > -- 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.