-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are refs metadata rather than tags? #17
Comments
EDN tag literals are like macros and great for immediate read-time I'm curious why refs are metadata, and everything else uses tags. Is there — |
On my phone. Will fix up when back at a kb sorry! |
Ah, that makes a lot of sense! Thanks for the quick response. Still, metadata is data about data, whereas a tag alters the meaning or "type" of the data. Given this, would |
@weavejester I tend to agree that it should be a tag instead of metadata, however the implementation needs to still set a metadata flag on the returned value and be processed by walking down the tree and calling |
I was thinking that you could just create a "ref" placeholder type, and then walk the tree afterwards. For example: (defrecord Ref [keys])
(defmethod reader 'ref [_ _ value]
(->Ref value))
(defn resolve-refs [config]
(walk/postwalk #(if (instance? Ref %) (get-in config (:keys %)) %) config)) |
I agree that ref metadata feels wrong now. Let's reconsider it and test an alternative approach prior to 1.0 final. I definitely not married to the ^:ref syntax and it feels a little inconsistent. |
This can now be considered done I think. |
README should be updated with |
#45 updates the README. |
This has been implemented. They are now tags. |
I'm curious why refs are metadata, and everything else uses tags. Is there a reason for this?
The text was updated successfully, but these errors were encountered: