Guidance on working with reader macros
Is it in scope for this lib to support transforms involving reader macros? I'm not sure how this would work so totally understand if it's out of scope :)
(require '[borkdude.rewrite-edn :as r])
(def z (r/parse-string "{:data {:foo #profile {:prod 1 :dev 2}}}"))
(r/get-in z [:data :foo]) ;-> <reader-macro: #profile {:prod 1 :dev 2}>
(r/assoc-in z [:data :foo :prod] false) ;-> NPE
Show me how you would use get-in with normal EDN that contains a reader macro
Show me how you would use
get-inwith normal EDN that contains a reader macro
Yeah I don't really know how that would work either 😅 I was just thinking of transforming aero configs using rewrite-edn so that's where that line of thinking is coming from...
I don't know the answer either but would be happy to hear what you came up with :)
Actually, thinking about this more, couldn't there just be a special way of "entering" the value behind the reader macro? I guess that's possible with rewrite-clj already... 💡 I think I just need dive into rewrite-clj a bit more :)
Feel free to close this :)
Yes, I guess we could support that, e.g. (get-in [:foo :bar ?? :prod]) but what would go on the question marks?
That's the question, isn't it? 😀 Maybe something like this?
(r/get-in [:foo :bar (r/reader-tag 'profile) :prod])
I'd be willing to support that