Skip to content

Commit

Permalink
mention axes in docs instead of size (#26233)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne authored Feb 27, 2018
1 parent f09a8d7 commit 3ae519d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Return a tuple containing the dimensions of `A`. Optionally you can specify the
dimension(s) you want the length of, and get the length of that dimension, or a tuple of the
lengths of dimensions you asked for.
Note that `size` may not be defined for arrays with non-standard indices, in which case [`axes`](@ref)
may be useful. See the manual chapter on [arrays with custom indices](@ref man-custom-indices).
# Examples
```jldoctest
julia> A = fill(1, (2,3,4));
Expand All @@ -49,6 +52,8 @@ size(x, d1::Integer, d2::Integer, dx::Vararg{Integer, N}) where {N} =
Return the valid range of indices for array `A` along dimension `d`.
See also [`size`](@ref), and the manual chapter on [arrays with custom indices](@ref man-custom-indices).
# Examples
```jldoctest
julia> A = fill(1, (5,6,7));
Expand Down
2 changes: 1 addition & 1 deletion base/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Given the type of an iterator, return one of the following values:
* `SizeUnknown()` if the length (number of elements) cannot be determined in advance.
* `HasLength()` if there is a fixed, finite length.
* `HasShape{N}()` if there is a known length plus a notion of multidimensional shape (as for an array).
In this case `N` should give the number of dimensions, and the [`size`](@ref) function is valid
In this case `N` should give the number of dimensions, and the [`axes`](@ref) function is valid
for the iterator.
* `IsInfinite()` if the iterator yields values forever.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/devdocs/offset-arrays.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arrays with custom indices
# [Arrays with custom indices](@id man-custom-indices)

Julia 0.5 adds experimental support for arrays with arbitrary indices. Conventionally, Julia's
arrays are indexed starting at 1, whereas some other languages start numbering at 0, and yet others
Expand Down

0 comments on commit 3ae519d

Please sign in to comment.