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

doc: fix accumulate examples not using the init keyword #28910

Merged
merged 2 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/src/manual/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,14 @@ the Julia documentation itself. For example:

```julia
"""
accumulate!(op, y, x)
tryparse(type, str; base)

Cumulative operation `op` on a vector `x`, storing the result in `y`. See also [`accumulate`](@ref).
Like [`parse`](@ref), but returns either a value of the requested type,
or [`nothing`](@ref) if the string does not contain a valid number.
"""
```

This will create a link in the generated docs to the `accumulate` documentation
This will create a link in the generated docs to the `parse` documentation
Copy link
Member

Choose a reason for hiding this comment

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

"and nothing"? Also should the parse have a @ref in this sentence (it kinda shows what is described with an example then)

Copy link
Member Author

Choose a reason for hiding this comment

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

I hesitated for nothing as it doesn't fall in the one the two categories below (mutating/non-mutating and similar-seeming functions), but no problem to do it. Good idea to add a ref link here too.

(which has more information about what this function actually does). It's good to include
cross references to mutating/non-mutating versions of a function, or to highlight a difference
between two similar-seeming functions.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/parallel-computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ julia> function g_fix(r)
g_fix (generic function with 1 method)

julia> r = let m = MersenneTwister(1)
[m; accumulate(Future.randjump, m, fill(big(10)^20, nthreads()-1))]
[m; accumulate(Future.randjump, fill(big(10)^20, nthreads()-1), init=m)]
end;

julia> g_fix(r)
Expand Down