Created
September 25, 2010 17:32
-
-
Save eschulte/597084 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
(defn first-where | |
"Return the index in coll of the first place where f returns true." | |
[f coll] | |
(loop [ind 0 c coll] (if (f (nth c ind)) ind (recur (inc ind) coll)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment