Porting Fortran code, negative indices

this is not right:

julia> ro = fortran_index(-5:5,-5)
1:11

julia> ro[-5:5]
ERROR: BoundsError: attempt to access 11-element UnitRange{Int64} at index [-5:5]
Stacktrace:

fear not, multi-dispatch is born for this, if Fortran didn’t struggle, I would bet it takes minimal effort for OffsetArray to work. OffsetArray wraps any Array, it only changes the getindex() behavior, so you don’t need to worry about underlying Array as long as you don’t overly constraint your function argument type.