I just stumbled on two phrases in the manual that puzzle me:
In Arrays · The Julia Language it says
Note that
size
may not be defined for arrays with non-standard indices, in which caseaxes
may be useful. See the manual chapter on arrays with custom indices.
What kind of array doesn’t have a size
defined? I can’t find an example, and the “chapter on arrays with custom indices” only says:
In some cases it may also be helpful to temporarily disable
size
andlength
for your new array type, since code that makes incorrect assumptions frequently uses these functions.
which sounds more like a temporary debug thing than a real array without size
.
The other phrase is at Arrays with custom indices · The Julia Language :
For this reason, your best option may be to iterate over the array with
eachindex(A)
, or, if you require the indices to be sequential integers, to get the index range by callingLinearIndices(A)
.
In which case would eachindex(A)
give values that are not sequential integers?