I keep getting empty maps when i am passing data into two hash maps in clojure, i know that the data is being sent through the functions as i have used print statements that show it correct data, its just when i assoc the data to the map it doesnt appear to do anything and leaves me with {}
Can anyone see what i am doing wrong??
(defn sort-string [y]
(apply str (sort y)))
(defn get-unique [y]
(let [x (sort-string (str/lower-case y))
hashmap1 (hash-map)
hashmap2 (hash-map)]
(if-not (contains? hashmap1 x)
(assoc hashmap1 x, y)
(assoc hashmap2 y, y))
(if-not (get hashmap1 x) y)
(dissoc hashmap2 (get hashmap1 x))))
(for [strings '("door" " rood" "pen" "open" "high" "low" "wall" "lawl" "#")]
(get-unique strings))
See Question&Answers more detail:os