Here is what I have:
(def my-atom (atom []))
(defn add-to-my-atom! [x]
(swap! my-atom conj x))
How do I append value to the vector only if it's not present already? I want to be able to use a predicate for the testing. For example in Common Lisp there is pushnew:
pushnew item place &key key test test-not
Is there something similar in Clojure? Perhaps, I should use sets instead of vectors. Fine. How do you define predicate that set will use to compare its values? For example, set can contain strings, and suppose that differences in case should not affect operations on sets, how Clojure deals with that?