Auto-namespaced keywords are expanded to normal namespaced keywords during read time, so once you have them in a data structure, they are printed with namespace:
$ clj
Clojure 1.10.0
user=> (pr-str ::out)
":user/out"
How did you manage to make (pr-str ::out)
print ::out
?
Edit:
What you are observing is the fact that clojure allows you to contruct keywords that are not readable when they are printed.
(keyword ":out")
constructs a keyword that has no namespace and ":out"
as a name, so when it is printed as "::out"
, it's not that it's printed as "autonamespaced", it just prints it's name (":out"
) after colon ":"
that identifies it as a keyword. You can go wild with constructing keywords from strings:
(keyword "heh [{:a 1}]" "//::! :: ::")
will produce a keyword with namespace "heh [{:a 1}]"
and name "//::! :: ::"
, it's printed like that :heh [{:a 1}]///::! :: ::
.
Since in your case there is no way to clean your data, I'd suggest using serialization that allows custom readers and writers for different types instead of edn. Take a look at transit, for example