Re:Giving up on Julia
by gh02t on Friday May 13, 2016 @11:17PM
(#11694414)
Fortran has the rather unusual feature that you can change the indexing to an arbitrary offset. You can declare arrays to be indexed from 0 if you want, but it defaults to 1 and almost nobody uses this feature for obvious reasons.
[ Parent
| on HN ]
I index from -N:N so that 0 is in the centre of my computational boxes.
Yeah, something like this is the intended use, but it isn't used much at least in the Fortran I've seen. Mostly because it's really confusing for someone reading your code, as once the array is declared there's no indication what the index range is.
Re:Giving up on Julia
by jimktrains2 on Saturday May 14, 2016 @01:18AM
(#11694646)
BASIC did as well IIRC.
Pascal as well I think. I dunno which was the first to support it, but it's not exactly a popular thing in modern programming.
Pascal even let you index with non-numeric types, so you could have an array indexed by the characters a to z, for example.