[TUHS] Array index history

Lyndon Nerenberg lyndon at orthanc.ca
Thu Jun 8 02:31:56 AEST 2017


> Basically, until C came along, the standard practice was for indices
> to start at 1. Certainly Fortran and Pascal did it that way. I suspect
> that all the Algol family languages did too, but I only did a little
> Algol W programming in colledge and that was long ago. I think Cobol also.

APL (excepting some early implementations) lets you set the "index origin" 
to either 0 or 1, either by assigning a value to the quad-IO system 
variable, or through the ')ORIGIN' command (varies with the 
implementation).

Changing quad-IO inside a function at runtime was a trick used to inflict 
endless terror on many a first-year undergrad ;-)

--lyndon




More information about the TUHS mailing list