Logo

Programming-Idioms

History of Idiom 172 > diff from v20 to v21

Edit summary for version 21 by OstravaBro:
[Clojure] Used k and v rather for fields and explained comment more.

Version 20

2020-04-29, 09:09:59

Version 21

2020-04-29, 09:11:35

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Extra Keywords
associative
Extra Keywords
associative
Code
(assoc m :k v)
Code
(assoc m k v)
Comments bubble
Given a map m, adds the key :k with value v.
Comments bubble
Given a map m, adds the key k with value v. Returns a new map.
Doc URL
https://clojuredocs.org/clojure.core/assoc
Doc URL
https://clojuredocs.org/clojure.core/assoc