-
Notifications
You must be signed in to change notification settings - Fork 82
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
lein marg
fails when a map value symbol contains a double colon
#165
Comments
I've literally never seen anyone name things with a colon in the middle. Thank you for the interesting case. |
Further investigation shows that it can handle vars with colons; it's maps with values that have colons in them that it chokes on: |
I was able to make a minimal case for this one at the repl: |
Not sure why this works at the REPL: because this is exactly what gets called by this code to make a LineNumberingPushbackReader just like I did above https://github.com/gdeer81/marginalia/blob/b2d82b1c84bedc4fb89430cea374143c909249c0/src/marginalia/parser.clj#L440 Then this code calls so |
lein marg
fails when a symbol contains a double colonlein marg
fails when a map value symbol contains a double colon
I'm running into this too. While not super common, I've seen symbol names with colons in them in other projects. They're fairly common in Emacs Lisp, where they're often used either for namespacing or for a group of functions that do similar things. For example in We're doing something similar in Metabase where we have two functions to fetch "Cards", one to fetch Cards for a Database and another for Cards for a Table. They're named |
I think #163 would help, just to join the dots here. |
Just a note that I experienced that issue while working on generating an XML for SAML with hiccup. (hiccup/html
[samlp:AuthnRequest
{xmlns:samlp "urn:oasis:names:tc:SAML:2.0:protocol"
:ID identifier
:Version "2.0"
:IssueInstant date
:ProtocolBinding "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
:ProviderName sp-id
:IsPassive false
:Destination authorize-uri
:AssertionConsumerServiceURL uri}
[saml:Issuer
{xmlns:saml "urn:oasis:names:tc:SAML:2.0:assertion"}
uri]]) |
This is definitely happening because of the custom colon reader introduced in this 2011 commit that handles double-colon-namespaced keywords. Looks like |
Hi! Me and my team use some sort of a hungarian notation in our project, which goes like this:
mk:stuff
when it yields a data structure,mkfn:stuff
when it yields a function that returns a data structure, etc.This issue can be reproduced by creating a bunch of symbols with double colons in them, and then use them as values in a hashmap, like this
It doesn't help if I quote them,
'mk:bar
, or use only as a symbol and try to var-get it later#'mk:foo
.This is the error message I get:
The text was updated successfully, but these errors were encountered: