vary-meta

functionsince v0.0-927 clojure.core/vary-metaEdit
(vary-meta obj f)
(vary-meta obj f a)
(vary-meta obj f a b)
(vary-meta obj f a b c)
(vary-meta obj f a b c d)
(vary-meta obj f a b c d & args)

Details:

Returns an object of the same type and value as obj, with (apply f (meta obj) args) as its metadata.


Examples:

(def a ^:foo [1 2 3])
(def b (vary-meta a assoc :bar true))

(= a b)
;;=> true

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

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

See Also:


Source docstring:
Returns an object of the same type and value as obj, with
(apply f (meta obj) args) as its metadata.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn vary-meta
 ([obj f]
   (with-meta obj (f (meta obj))))
  ([obj f a]
   (with-meta obj (f (meta obj) a)))
  ([obj f a b]
   (with-meta obj (f (meta obj) a b)))
  ([obj f a b c]
   (with-meta obj (f (meta obj) a b c)))
  ([obj f a b c d]
   (with-meta obj (f (meta obj) a b c d)))
  ([obj f a b c d & args]
   (with-meta obj (apply f (meta obj) a b c d args))))