Array start index
QAston via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 2 14:58:46 PDT 2015
On Saturday, 1 August 2015 at 23:02:51 UTC, bachmeier wrote:
> But what type of programming are you doing? Even after decades
> of programming and trying out dozens of languages, zero-based
> indexing still gets me at times when the arrays I work with
> represent vectors and matrices. Especially when porting code
> from other languages that use one-based indexing. One of the
> nice things about D is that it gives you the tools to easily
> make the change if you want.
Adding 1-indexed arrays to the language fixes nothing. Just write
your 1-indexed array type and if you enjoy using it, publish it
as a library. Who knows, if demand is high it may even end up in
phobos.
More information about the Digitalmars-d-learn
mailing list