summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/core.clj7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 4867e31c..f46d9063 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1861,6 +1861,11 @@
"Returns the Class of x"
[#^Object x] (if (nil? x) x (. x (getClass))))
+(defn type
+ "Returns the :type metadata of x, or its Class if none"
+ [x]
+ (or (:type (meta x)) (class x)))
+
(defn num
"Coerce to Number"
{:tag Number
@@ -1977,7 +1982,7 @@
(def #^{:private true} print-initialized false)
-(defmulti print-method (fn [x writer] (class x)))
+(defmulti print-method (fn [x writer] (type x)))
(defmulti print-dup (fn [x writer] (class x)))
(defn pr-on