From the reader docs:
Keywords are like symbols, except:
They can and must begin with a colon, e.g. :fred.
They cannot contain '.' or name classes.
A keyword that begins with two colons is resolved in the current namespace
and
A symbol can contain one or more non-repeating ':'s.
So it looks like the docs should explicitly allow :my:keyword
as a keyword.
This works in my REPL:
user=> {:my:keyword 1}
{:my:keyword 1}
and this works:
user=> {:mykeyword
#_=> 1}
{:mykeyword 1}
and even this works
=> (clojure.edn/read-string (pr-str {:my:keyword 1}))
{:my:keyword 1}
But this doesn't:
user=> {
#_=> :my:keyword
RuntimeException EOF while reading, starting at line 1
clojure.lang.Util.runtimeException (Util.java:221)
I can't put a newline in the middle of a hashmap literal immediately following a keyword containing a colon.
I can do this for other keywords. This works OK.
user=> {
#_=> :one
#_=> 1
#_=> }
{:one 1}
Why? Is this just a quirk of the reader? AFAICT :my:keyword
is a syntactically valid keyword. Should I be worried about other inconsistencies?
I'm using
REPL-y 0.3.5,
nREPL 0.2.6
Clojure 1.6.0