diff --git a/clj/src/cljd/core.cljd b/clj/src/cljd/core.cljd index 566538a9..07e35336 100644 --- a/clj/src/cljd/core.cljd +++ b/clj/src/cljd/core.cljd @@ -830,6 +830,10 @@ (.-isNaN o) (.write ^StringSink sink "##NaN") :else (.write ^StringSink sink (.toString o))))) +(extend-type List + IPrint + (-print [o sink] (print-sequential "[" "]" o sink))) + (defn ^bool string? "Return true if x is a String" {:inline (fn [x] `(dart/is? ~x String)) @@ -1689,7 +1693,7 @@ (cond (.== double/negativeInfinity o) -1048576 (.== double/infinity o) 2146435072 - (.== double/nan o) 2146959360 + (-> ^double o .-isNaN) 2146959360 true (m3-hash-int (.-hashCode o)))) (-hash-realized? [o] true)) diff --git a/clj/test/cljd/test_clojure/core_test_cljd.cljd b/clj/test/cljd/test_clojure/core_test_cljd.cljd index dc396c41..2a613c9c 100644 --- a/clj/test/cljd/test_clojure/core_test_cljd.cljd +++ b/clj/test/cljd/test_clojure/core_test_cljd.cljd @@ -905,3 +905,6 @@ (deftest nil-is-not-a-set-but-disj-must-work (is (not (set? nil))) (is (nil? (disj nil :a)))) + +(deftest dart-lists-obey-print-readably + (is (= "[\"hello\"]" (pr-str #dart ["hello"]))))