Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created October 15, 2011 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/1290310 to your computer and use it in GitHub Desktop.
Save amalloy/1290310 to your computer and use it in GitHub Desktop.
(defn remove-dupes [coll]
(loop [out [], coll coll]
(if-let [coll (seq coll)]
(let [x (first coll)
xs (rest coll)]
(recur (if (some #{x} out)
out
(conj out x))
xs))
out)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment