-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #794: Limited support for IPrintWithWriter in CLJS on custom types (
#798)
- Loading branch information
Showing
8 changed files
with
103 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ | |
SciPrintMethod | ||
(-sci-print-method [this w] | ||
(if-let [rv var] | ||
(let [m (meta @rv)] | ||
(let [m (meta rv)] | ||
(if-let [pm (:sci.impl/print-method m)] | ||
(pm this w) | ||
(.write ^java.io.Writer w ^String (clojure-str this)))) | ||
|
@@ -222,8 +222,13 @@ | |
|
||
IPrintWithWriter | ||
;; see https://www.mail-archive.com/[email protected]/msg99560.html | ||
(-pr-writer [new-obj writer _] | ||
(write-all writer (clojure-str new-obj))) | ||
(-pr-writer [this w opts] | ||
(if-let [rv var] | ||
(let [m (meta rv)] | ||
(if-let [pm (:sci.impl/print-method m)] | ||
(pm this w opts) | ||
(write-all w (clojure-str this)))) | ||
(write-all w (clojure-str this)))) | ||
|
||
IKVReduce | ||
(-kv-reduce [this f init] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters