From 629164ab060952fa25ce72315c70f5f3c9f049c0 Mon Sep 17 00:00:00 2001 From: Rafael Fourquet Date: Mon, 3 Sep 2018 21:19:59 +0200 Subject: [PATCH] doc: fix accumulate examples not using the init keyword (#28910) * doc: fix accumulate examples not using the init keyword * add links (KristofferC) (cherry picked from commit 49e58ba035ea8a02c29c21cf1f2204f3b20f8dff) --- doc/src/manual/documentation.md | 13 +++++++------ doc/src/manual/parallel-computing.md | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/src/manual/documentation.md b/doc/src/manual/documentation.md index 0eae97de6a4d9..195df3eae514c 100644 --- a/doc/src/manual/documentation.md +++ b/doc/src/manual/documentation.md @@ -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 diff --git a/doc/src/manual/parallel-computing.md b/doc/src/manual/parallel-computing.md index d8942ebd2567e..d0d291901546d 100644 --- a/doc/src/manual/parallel-computing.md +++ b/doc/src/manual/parallel-computing.md @@ -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)