-
-
Save jobez/27edc10dfe867deed82f to your computer and use it in GitHub Desktop.
remove-first
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
(defn remove-first [thing stuff] | |
(first (reduce (fn [acc el] | |
(if (= el thing) | |
(reduced (list* (rest stuff) acc)) | |
(conj acc el))) `() stuff))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment