8000 Suggestion: in-place creation compatible with JSON · Issue #207 · ChaiScript/ChaiScript · GitHub
[go: up one dir, main page]

Skip to content

Suggestion: in-place creation compatible with JSON #207

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

Closed
nxtruong opened this issue Aug 26, 2015 · 5 comments
Closed

Suggestion: in-place creation compatible with JSON #207

nxtruong opened this issue Aug 26, 2015 · 5 comments

Comments

@nxtruong
Copy link

Currently, in-place object creation uses the [] pair to create maps, e.g. ["id": 1, "name": "John"]. Is it possible to change the mark-up pair to {} (or support both)?. So {"id": 1, "name": "John"} produces the same object.

The reason I am asking for this change is to make the syntax compatible with a subset of JSON. With this, we can receive a JSON message in a string, pass it to Chaiscript and get a Chaiscript object of the JSON message. Just a suggestion.

@lefticus
Copy link
Member

Would it also work to just provide a JSON parser that you can call on demand, and it returns a ChaiScript object? This is something I'm strongly considering.

@nxtruong
Copy link
Author

That would be perfect. I would love to have JSON support in Chaiscript, but thought it would be quite some work. My previous suggestion seemed to be a simple change to partially achieve that, IMHO :-) Do you think we can have JSON support in the next major release? (so that I can plan my project accordingly).

@lefticus
Copy link
Member
lefticus commented Sep 7, 2015

I will attempt to get to this in the near future, but cannot guarantee anything for a few weeks.

@lefticus
Copy link
Member

I do have working to/from JSON support on a branch right now. I'm going to add some tests then merge it in with develop. https://github.com/ChaiScript/ChaiScript/tree/add_json_support

@lefticus
Copy link
Member

@nxtruong JSON support now pushed to develop. There are new from_json and to_json functions

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
0