Is there a way to instruct clojure.core.edn/read
how to resolve auto namespaced keywords ?
(edn/read-string "{:not-namespaced \"ko\" }") ;;=> {:not-namespaced "ko"}
(edn/read-string "{:namespaced/ok \"ko\" }") ;;=> #:namespaced{:ok "ko"}
(edn/read-string "{::namespaced \"ko\" }") ;;=> Unhandled java.lang.RuntimeException Invalid token: ::namespaced autonamespaced does not work
The last exception makes sense, since "A keyword cannot begin with ::".
I could use load-file
with this simple example, however I also need the extensibility of edn
(read custom tags).
Having a parameter to instruct how to resolve namespaces would make my config files (coerced with clojure.spec
) much more readable.