Nothing in Clojure is truly private. The defn-
is more of a way to convey that it is private to the readers. We can access private method by using var quote syntax.
Thevar
special form or the#'
reader macro (see Reader) can be used to get an interned Var object instead of its current value.
user=> (ns private)
nil
private=> (defn- secret[] "oops")
#'private/secret
private=> (ns user)
nil
user=> (private/secret)
CompilerException java.lang.IllegalStateException: var: #'private/secret is not public, compiling:(NO_SOURCE_PATH:4:1)
user=> (#'private/secret)
"oops"