3 ms·
> Except deadlocks have nothing to do with sharing memory, and everything to do with sharing state. Other languages using 1-indexed arrays: Fortran, Cobol, Sma
by masklinn 15y ago
> Except deadlocks have nothing to do with sharing memory, and everything to do with sharing state.
Other languages using 1-indexed arrays: Fortran, Cobol, Smalltalk, XPath, Erlang[0] and Lua (and a bunch of other very old languages like PL/1 or Algol).
All Wirthian languages (Pascal, Oberon, Ada, etc...) use configured index ranges (and provide primitives to query the array for its bounds), but I believe the convention is to use 1-index arrays when there are no special index semantics due to their strings being 1-indexed.
VB has configurable index ranges as well, but defaults to 0-indexed arrays.
You can also "configure" initial array index in Perl by setting `$[` I believe. Doing this will lead to you being beaten to death with ethernet cables by your colleagues. And if it does not, it should.
[0] though direct indexation is rarely used in erlang