Comment by fuzztester

1 year ago

IIRC some BASIC(s) I've used in the past had a statement called:

OPTION BASE 1

or something like that, to change the starting index to 1.

APL has ⎕IO←0 or ⎕IO←1 to change the starting index (only between 0 or 1, not arbitrarily). It doesn't apply system-wide so different code blocks/files/modules(?) can set or reset it, and portable code has to either set it or adjust for it.

APLCast podcast has an episode mentioning it where they all seem to agree that this is the worst of all worlds, makes sharing code and integrating codebases needlessly bug-prone, and the language picking a single indexing and sticking to it would have been better, even if the choice hadn't gone the way they would have personally chosen.

  • Interesting. Never used APL, though I tried J a little a few times.

    Yes, that seems bug prone, somewhat like having to have a config file per module.