3 ms·
The big drawback is that with 0-based indexing you can reference elements relative to the tail. If 0 is the first index and -1 the last index, then 1 is the sec
by bjourne 13y ago
The big drawback is that with 0-based indexing you can reference elements relative to the tail. If 0 is the first index and -1 the last index, then 1 is the second index, -2 the second last, 2 the third, -3 the third last and so on. 1..-1 would be all elements from the second up to including the second last.
I don't see how you could have indexing from the tail being internally consistent if the arrays are 1-indexed.
- astrieanna 13y agoJulia uses the keyword `end` to indicate the last index. 1 and end for the first and last, 2 and end-1 for the second and second to last, and so on.