Permalink
Browse files

Merge pull request #47 from sjl/master

(update-in ... assoc ...) to (assoc-in ...)
  • Loading branch information...
2 parents 176841c + c450d1d commit 37b2a6c62cd676db55b087cb488caf1e4d45c605 @jonase committed Jul 14, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 src/kibit/rules/collections.clj
  2. +2 −1 test/kibit/test/collections.clj
View
1 src/kibit/rules/collections.clj
@@ -8,6 +8,7 @@
[(assoc ?coll ?key (?fn (?key ?coll) . ?args)) (update-in ?coll [?key] ?fn . ?args)]
[(assoc ?coll ?key (?fn (?coll ?key) . ?args)) (update-in ?coll [?key] ?fn . ?args)]
[(assoc ?coll ?key (?fn (get ?coll ?key) . ?args)) (update-in ?coll [?key] ?fn . ?args)]
+ [(update-in ?coll ?keys assoc ?val) (assoc-in ?coll ?keys ?val)]
;; empty?
[(not (empty? ?x)) (seq ?x)]
View
3 test/kibit/test/collections.clj
@@ -17,4 +17,5 @@
'(update-in coll [k] f) '(assoc coll k (f (get coll k)))
'(update-in coll [k] f a b c) '(assoc coll k (f (k coll) a b c))
'(update-in coll [k] f a b c) '(assoc coll k (f (coll k) a b c))
- '(update-in coll [k] f a b c) '(assoc coll k (f (get coll k) a b c))))
+ '(update-in coll [k] f a b c) '(assoc coll k (f (get coll k) a b c))
+ '(assoc-in coll [k1 k2] v) '(update-in coll [k1 k2] assoc v)))

0 comments on commit 37b2a6c

Please sign in to comment.