Created
July 8, 2016 14:17
-
-
Save jjl/c76692d47981dbfd6d495b12063180dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn reexport [ns sym] | |
(cond (not (symbol? sym)) (throw (ex-info "reexport takes a symbol!" {})) | |
(not (namespace sym)) (throw (ex-info "reexport takes a namespaced symbol" {})) | |
:else | |
(let [v (resolve sym)] | |
(intern ns (-> sym name symbol (with-meta (meta v))) @v)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample usage: