Fork me on GitHub
#cider
<
2020-08-23
>
Sam Ritchie16:08:17

Hey all - in CLJS, I've implemented  `IPrintWithWriter`  for a js type called `Fraction`, and for some reason the repl, when printing, refuses to show a space:

Sam Ritchie16:08:27

;; implementation
(write-all writer "#sicm/frac " (str x))
(rationalize 1 10)
;; => #sicm/frac(/ 1 10)

Sam Ritchie16:08:34

pr-str does the right thing:

(pr-str (rationalize 1 10))
=> "#sicm/frac (/ 1 10)"

Sam Ritchie16:08:08

any escaped characters like `\"` cause it to stop printing. I was trying to get the repl output to match pr-str and print #sicm/frac (/ 1 10), with a space... any thoughts on what I'm doing wrong here?

Sam Ritchie16:08:33

this is with:

;; CIDER 0.25.0snapshot (package: 20200521.627), nREPL 0.7.0
;; Clojure 1.10.1, Java 1.8.0_221