Improve wording of index-of and last-index-of doc strings

Description

Feel free to decline this if it is too trivial. I was reviewing doc strings for new functions in Clojure 1.8.0, and those for clojure.string/index-of and clojure.string/last-index-of seem like they could be worded in a way that is much less subject to confusion.

Current doc string for clojure.string/index-of:

Return index of value (string or char) in s, optionally searching forward from from-index or nil if not found.

Issue: the lack of punctuation in the phrase "optionally searching forward from from-index or nil if not found" makes it appear that the "or" connects the first and last part of that phrase.

Suggested clarification:

Return index of value (string or char) in s, optionally searching forward from from-index. Returns nil if value not found.

Screened by: Alex Miller

Environment

None

Attachments

1
  • 01 Jan 2016, 11:01 AM

Activity

Alex Miller 
January 4, 2016 at 10:39 PM

I retracted my last comment, I think it's fine as is.

Andy Fingerhut 
January 1, 2016 at 11:01 AM

Patch clj-1837-v1.patch dated Jan 1 2016 modifies the doc strings of index-of and last-index-of as suggested.

Completed

Details

Assignee

Reporter

Approval

Patch

Priority

Affects versions

Fix versions

Created October 30, 2015 at 1:04 AM
Updated September 7, 2017 at 3:49 AM
Resolved September 7, 2017 at 3:49 AM