From 1bf246e4e4f849af5c3fe5a24979f058e74f25d5 Mon Sep 17 00:00:00 2001 From: Alexander Taggart Date: Fri, 20 May 2011 15:38:43 -0700 Subject: [PATCH] array-maps print-dup as literal instead of using read-eval --- src/clj/clojure/core_print.clj | 1 + test/clojure/test_clojure/printer.clj | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj index e484521..ef1a580 100644 --- a/src/clj/clojure/core_print.clj +++ b/src/clj/clojure/core_print.clj @@ -269,6 +269,7 @@ (defmethod print-dup clojure.lang.PersistentHashSet [o w] (print-method o w)) (defmethod print-dup clojure.lang.PersistentVector [o w] (print-method o w)) (defmethod print-dup clojure.lang.LazilyPersistentVector [o w] (print-method o w)) +(defmethod print-dup clojure.lang.PersistentArrayMap [o w] (print-method o w)) (def primitives-classnames {Float/TYPE "Float/TYPE" diff --git a/test/clojure/test_clojure/printer.clj b/test/clojure/test_clojure/printer.clj index 2b255e9..2bd028a 100644 --- a/test/clojure/test_clojure/printer.clj +++ b/test/clojure/test_clojure/printer.clj @@ -88,7 +88,9 @@ 1.0 "1.0" 1N "1N" 1M "1M" - "hi" "\"hi\"")) + "hi" "\"hi\"" + (hash-map :a :b :c :d) "{:a :b, :c :d}" + (array-map :a :b :c :d) "{:a :b, :c :d}")) (deftest print-dup-readable (are [form] (let [x form] @@ -97,4 +99,6 @@ 1.0 1N 1M - "hi")) \ No newline at end of file + "hi" + (hash-map :a :b) + (array-map :a :b))) \ No newline at end of file -- 1.7.3.5+GitX