diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 2ca029d8b2d16..5721ec77bfe49 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -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)); @@ -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)); diff --git a/base/generator.jl b/base/generator.jl index e11ed1a3cfb79..39d2270c43d51 100644 --- a/base/generator.jl +++ b/base/generator.jl @@ -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. diff --git a/doc/src/devdocs/offset-arrays.md b/doc/src/devdocs/offset-arrays.md index c26ac5870372e..5288f30a6d383 100644 --- a/doc/src/devdocs/offset-arrays.md +++ b/doc/src/devdocs/offset-arrays.md @@ -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