Fork me on GitHub
#clojure-dev
<
2019-04-04
>
Vincent Cantin10:04:55

I spotted a very strange behaviour with strings on Clojure 1.10.0

(transduce (map identity) str ["    a" "    b" "    c"])
; => "    a    b    c"
(transduce (interpose "\n") str ["    a" "    b" "    c"])
; => "    a\nb\nc"

bronsa10:04:04

[~]> clj
Clojure 1.11.0-master-SNAPSHOT
user=> (transduce (map identity) str ["    a" "    b" "    c"])
"    a    b    c"
user=> (transduce (interpose "\n") str ["    a" "    b" "    c"])
"    a\n    b\n    c"

bronsa10:04:07

which repl are you using?

bronsa10:04:39

probably an artifact of your repl then

Vincent Cantin10:04:33

You are right, it was the repl. It becomes obvious with (seq (transduce (interpose "\n") str [" a" " b" " c"]))