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