We never know how familiar with Julia the OP is, but just to point out that there are many alternatives to write the loops in a index-style-agnostic way:
for i in eachindex(v)
end
for (i,val) in pairs(v)
end
for val in v
end
such that if loops run on the complete arrays, these options can be used without relying on how the original array was indexed.