replace

functionsince v0.0-927 clojure.core/replaceEdit
(replace smap)
(replace smap coll)

Details:

Given a map of replacement pairs smap and a vector/collection coll, returns a vector/seq with any elements = to a key in smap replaced with the corresponding val in smap.

Returns a transducer when coll is not provided.


See Also:


Source docstring:
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.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn replace
  ([smap]
     (map #(if-let [e (find smap %)] (val e) %)))
  ([smap coll]
     (if (vector? coll)
       (let [n (count coll)]
         (reduce (fn [v i]
                   (if-let [e (find smap (nth v i))]
                     (assoc v i (second e))
                     v))
           coll (take n (iterate inc 0))))
       (map #(if-let [e (find smap %)] (second e) %) coll))))