Skip to content

Commit

Permalink
doc: fix accumulate examples not using the init keyword (#28910)
Browse files Browse the repository at this point in the history
* doc: fix accumulate examples not using the init keyword

* add links (KristofferC)

(cherry picked from commit 49e58ba)
  • Loading branch information
rfourquet authored and KristofferC committed Sep 8, 2018
1 parent a9bec19 commit 32bbe5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions doc/src/manual/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,16 +621,17 @@ 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
(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.
This will create a link in the generated docs to the [`parse`](@ref) documentation
(which has more information about what this function actually does), and to the
[`nothing`](@ref) documentation. 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.

!!! note
The above cross referencing is *not* a Markdown feature, and relies on
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

0 comments on commit 32bbe5f

Please sign in to comment.