clojure.core/replace¶
Given a map of replacement pairs and a vector/collection, returns a vector/seq with any elements = a key in smap replaced with the corresponding val in smap. Returns a transducer when no collection is provided.
Examples¶
Note by jneira¶
The behaviour for vectors was a little strange for me. I'd say replace "selects" from "smap" the indexes which are in "coll"
See also¶
- clojure.walk/prewalk-replace
- clojure.walk/postwalk-replace
- clojure.core/map (13)
- clojure.string/replace (8)
Content from the matching ClojureDocs page, with authors credited on each contribution.