3 ms·
Pascal and Ada have had arbitrary indexing for decades. It's been fine.
by Avshalom 10y ago
Pascal and Ada have had arbitrary indexing for decades. It's been fine.
- StefanKarpinski 10y agoAnd Fortran, where it works fine. Perl lets you change the array index offset but everyone warns you that your computer will reach out and slap you in the face if you do. As is often the case, the devil is in the details.
- ch_123 10y agoEiffel too IIRC (same family I suppose)
- nimrody 10y agoPascal and Ada don't usually use their arrays as matrices in mathematical expressions. Julia is targeted at people using Matlab. How do you multiply two matrices that use different indexing? Ignore the indexing differences? It's also problematic when different libraries use different conventions (0-based vs 1-based). Can you use the output of one such library to feed another?
- yaantc 10y agoAda has the notion of attributes applying to types and variables, to access related properties. Among those, there are attributes to get the starting and ending indexes of an array. So it's possible to program completely generic array processing, independent of the underlying choice or range for the array. All this from memory, and it's been a long time...