summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-01-22 14:08:43 +0000
committerRich Hickey <richhickey@gmail.com>2009-01-22 14:08:43 +0000
commit92a2a0477e3d056cf596a256e7787e1ad4caa3f1 (patch)
treea9323412ea46457bcb5b3d47838f9349ca07385d
parent3c9ebfc737cb581bf40d43d9d91dd65f7a8a117f (diff)
added vary-meta
-rw-r--r--src/clj/clojure/core.clj6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 1285dd2c..9b18b009 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -378,6 +378,12 @@
[#^clojure.lang.IFn f & args]
(. f (applyTo (spread args))))
+(defn vary-meta
+ "Returns an object of the same type and value as obj, with
+ (apply f (meta obj) args) as its metadata."
+ [obj f & args]
+ (with-meta obj (apply f (meta obj) args)))
+
(defn list*
"Creates a new list containing the item prepended to more."
[item & more]