juxt / aero

A small library for explicit, intentful configuration.
MIT License
743 stars 60 forks source link

Consider using namespace qualified tagged literals #44

Open RickMoynihan opened 7 years ago

RickMoynihan commented 7 years ago

I appreciate the succinct nature of the namespace free reader tags e.g. #ref but ideally these tags would be namespaced #juxt.aero/ref or perhaps just #aero/ref. clojure.org has this to say:

Reader tags without namespace qualifiers are reserved for Clojure.

And the edn-format spec re-echoes the same sentiment:

Tag symbols without a prefix are reserved by edn for built-ins defined using the tag system.

There may already be a collision here too, as integrant also defines #ref. How would one use both aero and integrant together?

RickMoynihan commented 7 years ago

See also similar bug on integrant: https://github.com/weavejester/integrant/issues/12

malcolmsparks commented 7 years ago

I agree and would vote for #aero/ref.

We could provide a reader option that will run in 'deprecated mode' that will match on unnamespaced keywords, giving people a compatibility option.

RickMoynihan commented 7 years ago

👍 to the compatibility option and agree that ^:deprecated flags would make sense on the old functions too.

puredanger commented 7 years ago

I second this issue!

dantheobserver commented 5 years ago

I found that this is a temporary solution to using integrant ref with the aero ref

  (binding [*data-readers* {'ig/ref ig/ref}]
    (aero/read-config (clojure.java.io/resource "config.edn")
                      {:profile profile})))

This way, I can use ig/ref in my config and it will resolve.