Yes, for order numbers it is more natural in plain English to use first than zeroth.
Zero comes more naturally at e.g. a geometric sequence, a_i = a * q^n, then a_0 = a, this is more natural. But in a tuple we do not compute with the indices, they just select an element which might be some other type than the other ones.
- Gergely
On Mon, 27 Oct 2025 at 14:25, Matthew Fluet matthew.fluet@gmail.com wrote:
I'm also in favor of 1-based tuples. Adding one other argument: I've never seen an extension of the lambda calculus with pairs that introduces projects `zth` and `fst`; it's always `fst` and `snd`.
-Matthew
On Mon, Oct 27, 2025 at 4:46 AM Florian Weimer fw@deneb.enyo.de wrote:
- John Reppy:
FYI, I think zero-based array indexing is an artifact of the fact that early C did not really have arrays; it just had syntactic sugar for pointer arithmetic. Fortran had (has?) 1-based indices and Algol and Pascal had arbitrary base indices.
On the other hand, if your language supports array slices (non-copying subarrays) and these slices preserve the original indices, you are effectively back to zero-based indexing: you have to access relative to the starting index of the slice, so the first element is at zero. Ada is like that, array slice elements go from Slice (Slice'First), Slice (Slice'First + 1) up to Slice (Slice'First + Slice'Length - 1). This is a bit strange because Ada arrays start at index 1. _______________________________________________ Poly/ML mailing list -- polyml@lists.polyml.org To unsubscribe send an email to polyml-leave@lists.polyml.org
Poly/ML mailing list -- polyml@lists.polyml.org To unsubscribe send an email to polyml-leave@lists.polyml.org