Coder Social home page Coder Social logo

AST values converted to strings about rage HOT 3 CLOSED

lwb4 avatar lwb4 commented on July 24, 2024
AST values converted to strings

from rage.

Comments (3)

lwb4 avatar lwb4 commented on July 24, 2024

Is there a way to preserve keywords while converting to JSON?

I didn't think about the use case of copy-pasting the AST into another script; I just wanted a collapsible tree-view and couldn't find a library for doing that with ClojureScript maps. Could that be done with EDN?

I'm planning on adding a drop down on the right hand side where you can switch between viewing JSON and viewing the pretty printed map.

from rage.

mfikes avatar mfikes commented on July 24, 2024

@lincoln-b I think converting to string-based values is OK, but you may need to write your own clj->js that handles keywords by calling str on them.

from rage.

lwb4 avatar lwb4 commented on July 24, 2024

Oops, forgot to leave a comment. I reimplemented clj->js with str instead of name on keywords, preserving the starting colon.

from rage.

Related Issues (3)

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.