How do I make a string from a lazy sequence in a clojure?
I use str to build strings all the time:
user> (str '(1 2 3) " == " '(1 2 3))
"(1 2 3) == (1 2 3)"
and about once a day I will be bitten on the ass:
user> (str '(1 2 3) " == " (map identity '(1 2 3)))
"(1 2 3) == clojure.lang.LazySeq@7861"
I guess I can say:
user> (with-out-str (print '(1 2 3) " == " (map identity '(1 2 3))))
"(1 2 3) == (1 2 3)"
instead, but seems ugly. Is there a better way?
+3
source to share
2 answers