From mboxrd@z Thu Jan 1 00:00:00 1970 From: bakul@bitblocks.com (Bakul Shah) Date: Wed, 07 Jun 2017 17:47:33 -0700 Subject: [TUHS] Array index history In-Reply-To: Your message of "Wed, 07 Jun 2017 07:20:43 MDT." <201706071320.v57DKhmJ026303@freefriends.org> References: <201706071320.v57DKhmJ026303@freefriends.org> Message-ID: <20170608004733.29524124AEC2@mail.bitblocks.com> On Wed, 07 Jun 2017 07:20:43 MDT arnold at skeeve.com wrote: > > Basically, until C came along, the standard practice was for indices > to start at 1. Certainly Fortran and Pascal did it that way. Pascal's array type syntax is array-type: "array" "[" index-type "]" "of" type Index type could be an integer sub-range or scalar type or scalar sub-range. Pascal doesn't allow specifying array size with a simple integer so the question of default index for first element doesn't arise. In spite of having learned and used Pascal, PL/I, Fortran and APL before C, a lower bound of 0 seemed most sensible to me. Not because of any efficiency reasons but because of modular arithmetic which I learned before C!