Created
September 10, 2015 23:37
-
-
Save orderthruchaos/70962bffa894766dd481 to your computer and use it in GitHub Desktop.
Implementation of `def-` for Clojure
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 bnd-utils) | |
; Based on the definition of defn- | |
(defmacro def- | |
"same as def, yielding non-public def" | |
[name & decls] | |
(let [m (assoc (meta name) :private true)] | |
`(do | |
(def ~name ~@decls) | |
(alter-meta! (var ~name) assoc :private true)) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know... I know... https://groups.google.com/d/msg/clojure/r_ym-h53f1E/EQ-3Q4UpQwEJ
Still... I like it.