I believe the original intent was that keywords with a digit immediately
after the colon would not be supported, but due to a bug in the Clojure
reader they were permitted.  There was a brief time in 2013 where this bug
was fixed, but there were enough extant Clojure code bases that used such
keywords, that the change was reverted.  See the comments on the Clojure
ticket below for some history:

https://dev.clojure.org/jira/browse/CLJ-1252

I believe that this bug has never existed for namespaced keywords, and I am
not aware of any desire to change Clojure to allow such keywords.

Andy


On Tue, Jan 29, 2019 at 5:12 PM Philip Markgraf <pmarkg...@gmail.com> wrote:

> Thank you. I apologize that my condensed example was in error. (Is the
> error you are showing that you can't create a namespaced keyword in a
> namespace you are not in?)
>
> However, the condition I originally describe occurs when the original
> namespace is properly created with ns:
>
> user=> (ns name1)
> nil
> name1=> (def ex1 {:015-00 "1"})
> #'name1/ex1
> name1=> (def ex2 {::015-00 "2"})
> #'name1/ex2
> name1=> (::015-00 ex2)
> "2"
> name1=> (ns name2)
> nil
> name2=> (::name1/015-00 name1/ex2)
>
> Syntax error reading source at (REPL:1:16).
> Invalid token: ::name1/015-00
> Syntax error reading source at (REPL:1:27).
> Unmatched delimiter: )
> name2=>
>
>
>
> On Tuesday, January 29, 2019 at 4:49:54 PM UTC-8, Justin Smith wrote:
>>
>> you are misusing the :: alias resolution operator, user is not an alias
>>
>> Clojure 1.9.0
>> (ins)user=> (ns foo)
>> nil
>> (ins)foo=> ::user/a
>> RuntimeException Invalid token: ::user/a
>> clojure.lang.Util.runtimeException (Util.java:221)
>> (ins)foo=> :user/a
>> :user/a
>>
>> On Tue, Jan 29, 2019 at 2:52 PM Philip Markgraf <pmar...@gmail.com>
>> 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 clo...@googlegroups.com
>> > Note that posts from new members are moderated - please be patient with
>> your first post.
>> > To unsubscribe from this group, send email to
>> > clojure+u...@googlegroups.com
>> > 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 clojure+u...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to