summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-02-27 12:58:49 +0000
committerRich Hickey <richhickey@gmail.com>2009-02-27 12:58:49 +0000
commit6ab23a6e3c4c65868dcf042bd851933202b80f65 (patch)
tree13716f5cbaeb3b1f17699e223444bdd0ec4a8eb2 /src
parent6018e1c033c2eac2bc4452fc0f5e2b1b93d6df4e (diff)
fix print-method for objects with :type meta but no print-method, patch from Konrad Hinsen
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/core_print.clj5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj
index 9ec08dfa..228b8cb3 100644
--- a/src/clj/clojure/core_print.clj
+++ b/src/clj/clojure/core_print.clj
@@ -68,6 +68,9 @@
(pr-on m w))
(.write w " "))))
+(defmethod print-method :default [o, #^Writer w]
+ (print-method (vary-meta o #(dissoc % :type)) w))
+
(defmethod print-method nil [o, #^Writer w]
(.write w "nil"))
@@ -80,7 +83,7 @@
(print-args o w)
(.write w ")"))
-(defmethod print-method :default [o, #^Writer w]
+(defmethod print-method Object [o, #^Writer w]
(.write w "#<")
(.write w (.getSimpleName (class o)))
(.write w " ")