The 'def' form should not be used inside of 'defn'. Local bindings should use 'let'.
When using the STM, 'ref-set' should not be used most of the time.
(def names (ref []))
(defn add-name [name] (dosync (alter names conj name)))
The 'alter' function will call 'conj' and the return value will be the new value of 'names'.