-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add index-of #95
Add index-of #95
Conversation
Thanks! I just thought of two more things, but pretty sure these are the last:
|
6b34885
to
b8bf6fa
Compare
Thanks for the updates. Can you wrap the docstring at 80 characters, as per a previous comment? e.g. (defn index-of
"Returns the index of the first occurrence of the item in the sequential
collection coll, or -1 if not found."
{:added "1.9.0"}
[^java.util.List coll item]
(if (nil? coll)
-1
(.indexOf coll item))) For some reason it's wrapped at a much smaller width. Once that's done I'll merge it in and cut a release. |
Thanks! |
This doesn't match clojure.string/index-of's behavior (return |
I assume the idea was to have it match the .indexOf method. However, it's a good point that the Clojure I think you're right though, @NoahTheDuke. I think it makes more sense for |
Sorry for not noticing until it got merged. 😓 |
You deserve credit for noticing it and catching it before I released! |
Fixes #54