I myself haven’t had the need specifically for 0-based arrays, so I haven’t contributed such a package myself, but I presume others will. (See https://discourse.julialang.org/t/multidimensional-arrays-with-0-based-indices/3325.) As @barche noted, the ZeroRange
type in CustomUnitRanges is all ready to go, so it’s not a very hard thing to add an AbstractArray
that starts indexing specifically at 0.
To me, it always seemed that the 1 vs 0 debate was vaguely silly, but you’re right that interoperability is an excellent reason to support this. If C returns an int
or array of int
s that are meant to be the index of another array, it’s nice not to have to always remember to add 1 every time you use it.