Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #47 from sjl/master

(update-in ... assoc ...) to (assoc-in ...)
  • Loading branch information...
commit 37b2a6c62cd676db55b087cb488caf1e4d45c605 2 parents 176841c + c450d1d
@jonase authored
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)))
Please sign in to comment.
Something went wrong with that request. Please try again.