This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns dj.plurality) | |
(defmacro defplural-body [pluralfn-name arg-list & resolver-body] | |
`(def ~pluralfn-name (let [implementations# ~(if (resolve pluralfn-name) | |
`(atom (or @(:dj.plurality/implementations (meta ~pluralfn-name)) | |
[])) | |
`(atom []))] | |
(with-meta (fn ~pluralfn-name ~(into [] (rest arg-list)) | |
(let [~(first arg-list) @implementations#] | |
~@resolver-body)) |