RefMap would be like RefSet but would resolve to a map {k -> ref} instead a refs set. Knowing the key can be useful (think handler registration).
Alternatively, extend the RefLike protocol with a resolve method and in expand-key postwalk the config via it, this would allow custom RefThings. Sample:
(defprotocol RefLike
(ref-key [r] "Return the key of the reference.")
(resolve [r config]))
;; ...
(defn- expand-key [config value]
(walk/postwalk
#(cond
(reflike? %) (resolve % config)
:else %)
value))
RefMapwould be likeRefSetbut would resolve to a map{k -> ref}instead a refs set. Knowing the key can be useful (think handler registration).Alternatively, extend the
RefLikeprotocol with aresolvemethod and inexpand-keypostwalk the config via it, this would allow customRefThings. Sample: