with-meta

functionsince v0.0-927 clojure.core/with-metaEdit
(with-meta o meta)

Details:

Returns an object of the same type and value as obj, with map m as its metadata.


Examples:

(def a ^:foo [1 2 3])
(def b (with-meta a {:bar true}))

(= a b)
;;=> true

(meta a)
;;=> {:foo true}

(meta b)
;;=> {:bar true}

See Also:


Source docstring:
Returns an object of the same type and value as obj, with
map m as its metadata.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn with-meta
  [o meta]
  (if (js-fn? o)
    (MetaFn. o meta)
    (when-not (nil? o)
      (-with-meta o meta))))