diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-02-27 12:58:49 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-02-27 12:58:49 +0000 |
commit | 6ab23a6e3c4c65868dcf042bd851933202b80f65 (patch) | |
tree | 13716f5cbaeb3b1f17699e223444bdd0ec4a8eb2 /src | |
parent | 6018e1c033c2eac2bc4452fc0f5e2b1b93d6df4e (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.clj | 5 |
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 " ") |