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 builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |