assoc
-ing an update with the same key are hard to read. update
is known and
idiomatic.
Examples:
; bad (assoc coll :a (+ (:a coll) 5)) (assoc coll :a (+ (coll :a) 5)) (assoc coll :a (+ (get coll :a) 5))
; good (update coll :a + 5)
`assoc`-ing an update with the same key are hard to read. `update` is known and idiomatic. Examples: ; bad (assoc coll :a (+ (:a coll) 5)) (assoc coll :a (+ (coll :a) 5)) (assoc coll :a (+ (get coll :a) 5)) ; good (update coll :a + 5)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close