jonase / eastwood

Clojure lint tool
1.09k stars 66 forks source link

Unused private var is, in fact, used #4

Closed AlexBaranosky closed 10 years ago

AlexBaranosky commented 12 years ago

Hi @jonase,

In the below code, unused private var fact-begins is, in fact, used

(defn- fact-begins []
  (note-failure-in-fact false))

(defn- fact-checks-out? []
  (not *failure-in-fact*))

(defn form-providing-friendly-return-value [test-form]
  `(do 
     (#'fact-begins)
     ~test-form
     (#'fact-checks-out?)))
phillord commented 11 years ago

I get this problem as well. I am guessing that it results from direct use of the var, rather than the symbol.

I use this idiom for multimethods; I often use a var rather than a function for defmulti, otherwise the defonce semantics of defmulti requires a lot of REPL restarts.