When I define a private function in Clojure, I usually use a -
prefix as a visual indicator that the function cannot be used outside of my namespace, e.g.
(defn- -name []
(let [formatter (formatter "yyyy-MM-dd-HH-mm-ss-SSSS")]
(format "fixjure-%s" (unparse formatter (now)))))
But the -
prefix seems to also be a convention for public methods when using gen-class
.
Is there any generally accepted convention for defn-
'd functions in the Clojure community, or should I simply use non-prefixed names?
It seems that lots of code in clojure.contrib (may it rest in peace) uses normal names for private functions, so maybe that is best, but I really like the visual indicator--maybe my C / Perl background is just too strong! ;)