Permalink
Browse files

Improve merge-with to work with map-like types that don't implement c…

…lojure.lang.IFn for lookup

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent fde4f64 commit 673f4c70a82b6af9379aa7b7e8188c8b809fed51 @khinsen khinsen committed with stuarthalloway May 27, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/clj/clojure/core.clj
@@ -2273,7 +2273,7 @@
(let [merge-entry (fn [m e]
(let [k (key e) v (val e)]
(if (contains? m k)
- (assoc m k (f (m k) v))
+ (assoc m k (f (get m k) v))
(assoc m k v))))
merge2 (fn [m1 m2]
(reduce merge-entry (or m1 {}) (seq m2)))]

0 comments on commit 673f4c7

Please sign in to comment.