Skip to content

Commit 260b414

Browse files
authored
docs: manual: fix inclusion and location of : doc strings (#59262)
This fixes issues with the location and lack of inclusion of the docs strings of `:` into the Manual: * The doc string for the metaprogramming functionality was mistakenly included into the page on math, instead of into Essentials. * The other doc strings, for the range functionality, were missing entirely from the manual, so include them into the page on math. These doc bugs were introduced all the way back in PR #19609!
1 parent 7df2a69 commit 260b414

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

base/multidimensional.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ module IteratorsMD
345345
CartesianIndices((2:1:3, 1:2:3))
346346
```
347347
"""
348+
(:)(::CartesianIndex, ::CartesianIndex, ::CartesianIndex)
349+
348350
(:)(I::CartesianIndex{N}, J::CartesianIndex{N}) where N =
349351
CartesianIndices(map((i,j) -> i:j, Tuple(I), Tuple(J)))
350352
(:)(I::CartesianIndex{N}, S::CartesianIndex{N}, J::CartesianIndex{N}) where N =

base/range.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ The operator `:` is also used in indexing to select whole dimensions, e.g. in `A
4949
`:` is also used to [`quote`](@ref) code, e.g. `:(x + y) isa Expr` and `:x isa Symbol`.
5050
Since `:2 isa Int`, it does *not* create a range in indexing: `v[:2] == v[2] != v[begin:2]`.
5151
"""
52+
(:)(::Any, ::Any, ::Any)
53+
5254
(:)(start::T, step, stop::T) where {T} = _colon(start, step, stop)
5355
(:)(start::T, step, stop::T) where {T<:Real} = _colon(start, step, stop)
5456
# without the second method above, the first method above is ambiguous with

doc/src/base/base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ where
108108
.=
109109
.
110110
->
111+
Base.:(:)
111112
::
112113
[]
113114
```

doc/src/base/math.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Base.:(<<)
3535
Base.:(>>)
3636
Base.:(>>>)
3737
Base.bitrotate
38-
Base.:(:)
38+
Base.:(:)(::Any, ::Any, ::Any)
39+
Base.:(:)(::CartesianIndex, ::CartesianIndex, ::CartesianIndex)
3940
Base.range
4041
Base.OneTo
4142
Base.StepRangeLen

0 commit comments

Comments
 (0)