Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST values converted to strings #1

Closed
mfikes opened this issue Jul 26, 2017 · 3 comments
Closed

AST values converted to strings #1

mfikes opened this issue Jul 26, 2017 · 3 comments

Comments

@mfikes
Copy link

mfikes commented Jul 26, 2017

Because of the use of cjls->js here, if you evaluate a form like :foo, the form part of the AST will be displayed as foo.

@lwb4
Copy link
Owner

lwb4 commented Jul 26, 2017

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.

@mfikes
Copy link
Author

mfikes commented Jul 27, 2017

@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.

@lwb4 lwb4 closed this as completed Jul 27, 2017
@lwb4
Copy link
Owner

lwb4 commented Jul 27, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants