Skip to content

Instantly share code, notes, and snippets.

@orderthruchaos
Created September 10, 2015 23:37
Show Gist options
  • Save orderthruchaos/70962bffa894766dd481 to your computer and use it in GitHub Desktop.
Save orderthruchaos/70962bffa894766dd481 to your computer and use it in GitHub Desktop.
Implementation of `def-` for Clojure
(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))
))
@orderthruchaos
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment