-
Notifications
You must be signed in to change notification settings - Fork 6
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
restrict symbol and keyword names #94
Conversation
I was surprised to find this case: https://github.com/VladimirMarkovic86/ocr-lib/blob/master/src/clj/ocr_lib/core.clj#L13
Had no idea this would work:
|
wow, that was unexpected. I wasnt sure if this was really "supported" or if this was a bug so I asked on the #clojure-dev channel and it seems to be a bug on Clojure side. The prove is that:
I will wait for more feedback on that and keep this PR as it is until then. Thanks again for the report and let me know if you find any other cases worth looking into :) |
Thanks for the inquiry -- I didn't expect multiple slashes to work (apart from Here are some other examples:
In order to get
Trying to feed in just
In any case, this looks like part of data that is consumed by I realize you have this: Line 205 in 33394cb
but FWIW, the current commit seems to not like some keywords with multiple slashes:
The source for that is (sorry got this wrong initially, edited to fix):
|
fix: make keyword consistent with clojure reader documentation
I made an errror in one of the code snippets above and have corrected it. Sorry about that. For reference, I believe the correct code and response is:
The original version was missing the |
Although the current Clojure reader implementation does "support" multiple Some projects out there currently rely on that but that still leaves the door open to consumers of this library as to what to do with those symbols/keywords at runtime. What is the name, what is the ns? without being able to answer those questions and without a clear position from the Clojure team, I am unwilling to push this responsability to the consumers and just "leave them on their own". Assuming that the current Clojure reader documentation is wrong; there would be no clear rules as to what a valid symbol/keyword is therefore parcera would just have to "accept anything" which not useful either. |
Thanks for mentioning CLJ-1530. FWIW, my impression is that use in symbols is less frequent than for keywords (though I don't have numbers). I guess this is another reason to work on querying code for certain patterns to get some measurements...I wonder if grape or grasp might be usefully applied. Not a particularly great idea may be, but in the case of keywords, I saw the portion after the colon as being URLs on more than a few occasions. If that is the main use case, perhaps that can be treated as a special case...This is just speculation though, I would imagine one would want some concrete data to back up this kind of thing. |
yeah, I have seen those. In general, I know that the Clojure team supports those through runtime keywords
For the time being Clojure follows the benevolent dictator for life workflow so even with data to back it up, the decision is still up to them. |
fix: only allow a singlenot possible in order to maintain backward compatibility of Clojure code. See comments below/
inside symbols:
is a valid character inside a symbol/