There are two interrelated issues here.
First, when you are using autoresolved keywords, the qualifier part must be
an alias. Here it is a fully-qualified namespace (user). Instead, you
should be using :user/015-00. Note that before Clojure 1.10, this would not
produce an error - this was an oversight that was tightened up in 1.10.
:user/015-00 introduces the second error. Keywords with a leading digit
were not originally legal (according to the reader reference), but have
been grandfathered in (like :1st, etc). However, qualified keywords with a
digit name have never been accepted by the reader and this is kind of an
unresolved issue.
On Tuesday, January 29, 2019 at 4:52:09 PM UTC-6, Philip Markgraf wrote:
>
> I am moving some code to use spec and namespaced keywords under Clojure
> 1.10.0 (release). One group of keywords starts with a numeric character
> after the colon, which has worked fine in the non-namespaced context.
> Creating and using the namespaced keyword works correctly in the local
> namespace (using only the double-colon), but fails with "Invalid Token"
> when dereferencing from another workspace.
>
> I'm not sure if this is a bug or if I have been taking advantage of an
> undocumented/unsupported feature.
> Having a leading-digit keyword has been very useful, as the names are an
> exacting fit of the problem domain and don't suffer from the addition of
> any visual pollution.
>
> user=> (def example-a {:015-00 "015-00"})
> #'user/example-a
> user=> (def example-b {::015-00 "015-00"})
> #'user/example-b
> user=> (:015-00 example-a)
> "015-00"
> user=> (:015-00 example-b)
> nil
> user=> (::015-00 example-b)
> "015-00"
> user=> (::015-00 example-a)
> nil
> user=> (ns try)
> nil
> try=> (:015-00 user/example-a)
> "015-00"
> try=> (::user/015-00 user/example-b)
>
> Syntax error reading source at (REPL:1:15).
> Invalid token: ::user/015-00
> Syntax error reading source at (REPL:1:31).
> Unmatched delimiter: )
> try=>
>
> The current behavior is certainly inconsistent, even if it is not a
> serious bug.
>
> Thank you!
>
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.