According to the reader page (http://clojure.org/reference/reader), keyword names can't start with a number. However, unqualified keywords that start with a number have (accidentally) worked for a long time and we have effectively grandfathered them in. You're seeing some of the ragged edges of this (which has nothing to do with spec). There is a longer history and a number of tickets related to this if you poke around in jira.
On Wednesday, June 29, 2016 at 9:25:41 AM UTC-5, Leon Grapenthin wrote: > > Have isolated more: Namespaced keywords with numbers in the name all don't > work, but when using double-colon syntax they can be fabricated. > > :a/1 -> RuntimeException Invalid token: :a/1 > clojure.lang.Util.runtimeException (Util.java:221) > :user/1 -> RuntimeException Invalid token: :a/1 > clojure.lang.Util.runtimeException (Util.java:221) > > ::1 -> :user/1 > > > On Wednesday, June 29, 2016 at 4:21:49 PM UTC+2, Leon Grapenthin wrote: >> >> I believe that this is a problem with how the reader resolves aliased >> keywords as the problem can be reproduced without spec. You should file a >> JIRA ticket. >> >> On Wednesday, June 29, 2016 at 9:22:49 AM UTC+2, Mamun wrote: >>> >>> Hi, >>> >>> Invalid token error from different namespace when specs are registered >>> with number >>> >>> Example >>> >>> ;one.clj >>> >>> (s/def ::a string?) >>> (s/def ::1 int?) >>> >>> ::1 ;Ok >>> ::a ;Ok >>> >>> ;one-test.clj >>> >>> :one/1 ;; Error >>> :one/a ;;Ok >>> >>> ;(gen/sample (s/gen ::1)) >>> ;(gen/sample (s/gen ::a)) >>> >>> >>> >>> I am not sure, it is bug or not. But error should display in same >>> namespace also. >>> >>> Clojure version: [org.clojure/clojure "1.9.0-alpha8"] >>> >>> >>> Br, >>> Mamun >>> >> -- 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.
