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

Add more symbols for bounds of %Q, and others #3467

Closed
kostya opened this issue Oct 24, 2016 · 2 comments
Closed

Add more symbols for bounds of %Q, and others #3467

kostya opened this issue Oct 24, 2016 · 2 comments

Comments

@kostya
Copy link
Contributor

kostya commented Oct 24, 2016

in ruby this is ok:

%Q|a|

in crystal not compiled.

this is usefull when want for example write json as string: this is not readable %Q[{"a":[1,2,3]}] and %Q{{"a":[1,2,3]}}, but this ok: %Q|{"a":[1,2,3]}|

@asterite
Copy link
Member

asterite commented Oct 25, 2016

This was discussed in #1598

You could use %Q<{"a":[1,2,3]}>, though now I changed my mind about this subject and probably | looks/reads good for us to add it to the language.

@kostya
Copy link
Contributor Author

kostya commented Oct 25, 2016

also about inspecting strings.
in specs for example it outputted like this, not readable:

       expected: "{\"result\":0,\"something\":2}"
       got: "{\"result\":0,\"something\":1}"

this is better, imho:

       expected: %q|{"result":0,"something":2}|
       got: %q|{"result":0,"something":1}|

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

No branches or pull requests

2 participants