Git Product home page Git Product logo

Comments (3)

bpsm avatar bpsm commented on September 26, 2024

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.

kotarak avatar kotarak commented on September 26, 2024

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.

bpsm avatar bpsm commented on September 26, 2024

Misbehaving printer is fixed in ceb7be0 and will be included in release 0.4.1.

from edn-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.