Created
May 2, 2013 06:32
-
-
Save amalloy/5500495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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