Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created May 2, 2013 06:32
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/5500495 to your computer and use it in GitHub Desktop.
Save amalloy/5500495 to your computer and use it in GitHub Desktop.
(fn remove-once [pred coll]
(lazy-seq
(when-let [coll (seq coll)]
(let [x (first coll), xs (rest coll)]
(if (pred x)
xs
(cons x (remove-once pred xs)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment