News for hackers. Stuff that matters.
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.
Re:Giving up on Julia by Extigy on Saturday May 14, 2016 @04:55AM (#11695175)
I index from -N:N so that 0 is in the centre of my computational boxes.
Re:Giving up on Julia by gh02t on Saturday May 14, 2016 @02:42PM (#11697487)
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.
Re:Giving up on Julia by gh02t on Saturday May 14, 2016 @01:39AM (#11694686)
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.
Re:Giving up on Julia by FreeFull on Saturday May 14, 2016 @10:31AM (#11696266)
Pascal even let you index with non-numeric types, so you could have an array indexed by the characters a to z, for example.
Re:Giving up on Julia by int_19h on Saturday May 14, 2016 @02:40AM (#11694799)
It was already there in Algol-60.