Skip to content

Commit 49e58ba

Browse files
rfourquetKristofferC
authored andcommitted
doc: fix accumulate examples not using the init keyword (#28910)
* doc: fix accumulate examples not using the init keyword * add links (KristofferC)
1 parent b1dac9f commit 49e58ba

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

doc/src/manual/documentation.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,16 +621,17 @@ the Julia documentation itself. For example:
621621

622622
```julia
623623
"""
624-
accumulate!(op, y, x)
624+
tryparse(type, str; base)
625625
626-
Cumulative operation `op` on a vector `x`, storing the result in `y`. See also [`accumulate`](@ref).
626+
Like [`parse`](@ref), but returns either a value of the requested type,
627+
or [`nothing`](@ref) if the string does not contain a valid number.
627628
"""
628629
```
629630

630-
This will create a link in the generated docs to the `accumulate` documentation
631-
(which has more information about what this function actually does). It's good to include
632-
cross references to mutating/non-mutating versions of a function, or to highlight a difference
633-
between two similar-seeming functions.
631+
This will create a link in the generated docs to the [`parse`](@ref) documentation
632+
(which has more information about what this function actually does), and to the
633+
[`nothing`](@ref) documentation. It's good to include cross references to mutating/non-mutating
634+
versions of a function, or to highlight a difference between two similar-seeming functions.
634635

635636
!!! note
636637
The above cross referencing is *not* a Markdown feature, and relies on

doc/src/manual/parallel-computing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ julia> function g_fix(r)
465465
g_fix (generic function with 1 method)
466466
467467
julia> r = let m = MersenneTwister(1)
468-
[m; accumulate(Future.randjump, m, fill(big(10)^20, nthreads()-1))]
468+
[m; accumulate(Future.randjump, fill(big(10)^20, nthreads()-1), init=m)]
469469
end;
470470
471471
julia> g_fix(r)

0 commit comments

Comments
 (0)