In Clojure and clojurescript, you might have a personal version of defn called defn-, but how do you do the same for def, since def doesn't seem to turn on?
You must add a pair of key values :private true metadata.
:private true
(def ^{:private true} some-var :value) ;; or (def ^:private some-var :value)
The second form is just short for the first.
If you want to define, here's how to implement it
(defmacro def- [item value] `(def ^{:private true} ~item ~value) )
It is worth noting that currently in ClojureScript there can be no private def (and defn ): https://clojurescript.org/about/differences (under "special forms")
def
defn
Compilation will not fail, but def will remain available.
There is a discussion on this topic in this google post group. Apparently, the request has been considered. According to one answer, defn- it was believed that this was not a good idea, and decided not to perpetuate it with def and others.
defn-