The specification seems ambiguous on this point. The definition of strings 
doesn't mention hex or octal escapes, but the definition of characters 
does. No relationship between characters and strings is specified. 
Characters are unicode, apparently; strings are unspecified.

On Thursday, March 30, 2017 at 2:13:23 AM UTC-7, Christophe Grand wrote:
>
> 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 
> <javascript:>> 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 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> 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 <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> On Clojure http://clj-me.cgrand.net/
> Clojure Programming http://clojurebook.com
> Training, Consulting & Contracting http://lambdanext.eu/ 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to