Skip to content
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

Revised Range Documentation #34475

Merged
merged 4 commits into from
Jan 26, 2020
Merged

Revised Range Documentation #34475

merged 4 commits into from
Jan 26, 2020

Conversation

kamalojasv181
Copy link
Contributor

@kamalojasv181 kamalojasv181 commented Jan 22, 2020

Closes #33798

@@ -53,11 +53,20 @@ Given a starting value, construct a range either by length or from `start` to `s
optionally with a given step (defaults to 1, a [`UnitRange`](@ref)).
One of `length` or `stop` is required. If `length`, `stop`, and `step` are all specified, they must agree.

If `length` and `stop` are provided and `step` is not, the step size will be computed
automatically such that there are `length` linearly spaced elements in the range (a [`LinRange`](@ref)).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it would be clearer to keep the

the step size will be computed automatically such that there are length linearly spaced elements in the range

part because it's important and applies to everything. Then say something like

"""
...in a range. The returned type depends on the inputs, a [`StepRangeLen`](@ref) for floating-point inputs and [`LinRange`](@ref) otherwise.
"""

because that's effectively a detail that most people won't need to worry about. (Since the docs for StepRangeLen mention error-free arithmetic, I think we're covered as far as "purpose" goes.)

@timholy
Copy link
Member

timholy commented Jan 23, 2020

Yes, deleting the info about return type seems like an OK solution to the problem too. Any other thoughts?

@kamalojasv181
Copy link
Contributor Author

Oh I thought you meant doing that in the first place. Anyways I think it would be great to do so for now.

@timholy
Copy link
Member

timholy commented Jan 25, 2020

Well, there don't seem to be any objections to just deleting the info about the return type. If you can clean up this branch with the extraneous stuff then I think we could merge it.

@kamalojasv181
Copy link
Contributor Author

Sorry for the trouble. Now we are back at where you want. It is ready to be merged.

base/range.jl Show resolved Hide resolved
@timholy timholy merged commit c4a0c83 into JuliaLang:master Jan 26, 2020
@timholy
Copy link
Member

timholy commented Jan 26, 2020

Thanks @kamalojasv181!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible documentation error: range function docstring at julia/base/range.jl
2 participants