tags:

views:

159

answers:

2

hello

I wanna remove duplicated value in list on clojure?

for example) from ("a" "b" "c" "a") to ("a" "b" "c")

+6  A: 

If you don't care about the order, you can simply convert the list to a set:

user=> (set '("a" "b" "c" "a" "lala" "d"))
#{"a" "b" "c" "d" "lala"}
sepp2k
In addition to ordering, pushing into a set isn't lazy, but `distinct` is.
Alex Taggart
Thank you also your answer.
rafael
+10  A: 
user=> (distinct '(34 56 45 34 56 89 11 4 11 78 11))
(34 56 45 89 11 4 78)
missingfaktor