Comments (3)
Looks like a bug relative to the behavior of clojure.core/pr. Also the Clojure reader rejects it.
Seems an obvious improvement to have edn-java no longer print this way.
What about reading though? Should it continue to accept "'", or conform to clojure's behavior (a breaking change)?
Why things ended up this way:
edn-format/edn says:
Strings are enclosed in "double quotes". May span multiple lines. Standard C/Java escape characters \t \r \n are supported.
The JLS considers "'" valid:
http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6
This message was sent via electromagnetism.
On 03.06.2013, at 18:11, Meikel Brandmeyer [email protected] wrote:
Printing a string containing single quotes will incorrectly escape these quotes with a backslash. In a groovy shell:
System.out.withWriter("UTF-8") { us.bspm.edn.printer.Printers.newPrinter(it).printValue("a 'b' c") }
"a 'b' c">
Version affected: 0.4.0—
Reply to this email directly or view it on GitHub.
from edn-java.
Well, the set of escape characters is listed, but then \a
and \b
are missing. I don't remember \'
being a C escape character though. But I don't know the standard. File a bug against edn for clarification?
Reading can probably continue to accept it. Normally it won't be produced (assuming a "correct" producer with "correct" meaning pr
alike). So the chance to encounter this is mostly historic edn-java produced data. On the other hand that would mean a slight glitch in handling corrupt input.
from edn-java.
Misbehaving printer is fixed in ceb7be0 and will be included in release 0.4.1.
from edn-java.
Related Issues (20)
- Iterate over list recieved via get. HOT 1
- > and < symbols are not supported HOT 3
- Values returned by Parser should be Serializable by default HOT 1
- Comma character prints incorrectly HOT 3
- PrintingExamples are sensitive to hash ordering HOT 1
- Teach edn-java to read namespaced maps as per CLJ-1910 HOT 1
- Teach edn-java to optionally print namespaced maps as per CLJ-1910
- Duplicate map keys are parsed without error HOT 5
- Add Java 8 to test with Travis too. HOT 1
- QuickCheck to test? HOT 1
- mispelling, in the docs
- Version 1.0? HOT 1
- Reader flag to support unicode escapes in string literals HOT 14
- Support reading \uXXXX character literals HOT 1
- Review edn-format; compare to implementation HOT 1
- Support # embedded in symbol names HOT 1
- Clojure's edn-read allows unicode in names, should edn-java do the same?
- Fix broken GPG magic HOT 4
- Octal escapes in string and character literals? HOT 1
- 0.7.0 or 0.7.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edn-java.