cavm.core=> (println (pr-str "foo\tbar"))
"foo\tbar"
nil
cavm.core=> (println (pr-str "foo\001bar"))
"foobar"
nil
I think that's just that \t is printed as \t. Like a tab shows up as \t. Whereas say a Unicode like \u1234 will show the character of it. You can seek that here:
(print (pr-str "foo\u0009bar"))
"foo\tbar"
Also, what is \001? I would have expected only the first 0 to be escaped. Is this a Java special escape syntax?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
A funny thing is that octal or hexadecimal escapes are not part of EDN (even if most readers recognize them).
On Wed, Mar 29, 2017 at 8:49 PM, Brian Craft <craft...@gmail.com> wrote:
A funny hole in the meta-programming story. I don't think the String or Character classes have methods that do this.Also interesting, clojure's print methods will handle some escapes, but not others:cavm.core=> (println (pr-str "foo\tbar"))
"foo\tbar"
nil
cavm.core=> (println (pr-str "foo\001bar"))
"foobar"
nil
Apparently org.apache.commons.lang3.StringEscapeUtils.escapeJava is one solution.On Wednesday, March 29, 2017 at 11:02:40 AM UTC-7, Alex Miller wrote:Clojure leans on Java to read that literal. There is no Clojure function to forcibly print it that way again, but you can probably use the Java methods on String or Character to get the String representation of a character somehow.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.