function | since v0.0-927 | clojure.core/with-meta | Edit |
(with-meta o meta)
Returns an object of the same type and value as obj
, with map m
as its
metadata.
(def a ^:foo [1 2 3])
(def b (with-meta a {:bar true}))
(= a b)
;;=> true
(meta a)
;;=> {:foo true}
(meta b)
;;=> {:bar true}
Returns an object of the same type and value as obj, with map m as its metadata.
(defn with-meta
[o meta]
(if (js-fn? o)
(MetaFn. o meta)
(when-not (nil? o)
(-with-meta o meta))))