-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve documentation of Array#[Range] #10243
Improve documentation of Array#[Range] #10243
Conversation
There are also |
Co-authored-by: Quinton Miller <nicetas.c@gmail.com>
|
@HertzDevil Looks like I had that already fixed but failed to push the changes. 🙈 |
src/string.cr
Outdated
self[*Indexable.range_to_index_and_count(range, size) || raise IndexError.new] | ||
end | ||
|
||
# Like `#[Range]`, but returns `nil` if the range's start is out of bounds. | ||
# Like `#[Range]`, but returns `nil` if `range.begin` is out of range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This #[Range]
syntax is really confusing and it is not recognized by the doc generator.
#[](Range)
would be recognized, though.
Same for #[](Int, Int)
.
I realize this is pre-existing, but on the other hand, this PR is about improving documentation.
Resolves #10222
This is only a draft for now, please review the wording for improvements.
I'll then copy appropriate documentation to
String#[Range]
.