Skip to content

Commit

Permalink
Merge pull request #47 from sjl/master
Browse files Browse the repository at this point in the history
(update-in ... assoc ...) to (assoc-in ...)
  • Loading branch information
jonase committed Jul 14, 2012
2 parents 176841c + c450d1d commit 37b2a6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/kibit/rules/collections.clj
Expand Up @@ -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)]
Expand Down
3 changes: 2 additions & 1 deletion test/kibit/test/collections.clj
Expand Up @@ -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.