I need to generate a random char and build a string and only stop when my string contains the newly generated char.
(defn rand-char [len]
(apply str (take len (repeatedly #(char (+ (rand 26) 65))))))
(def random-string
(loop [x (rand-char 1)
result []]
(if (some #(= x %) result)
(apply str (conj result x))
(recur (conj result x) (x (rand-char 1))))))
I am getting
java.lang.String cannot be cast to clojure.lang.IFn