On 25/10/2025 14:32, Gabriel Scherer wrote:
The argument in favor of 0-based is that it is what we use for arrays, so more consistent, standard in most programming languages. The argument in favor of 1-based is that it is arguably more intuitive (but the inconsistency with arrays weakens this claim noticeably), and that SML uses it.
Question: you have a lot more experience using tuple indexing. In your opinion, if this was to be decided again for a new system (no backward- compatibility concerns), would you still recommend using 1-based indices, or would you be more in favor of 0-based indices?
I am normally a purist in counting almost everything from 0, but for tuples I would not do it. It just asking for too much trouble, in conflict with usual mathematical customs like (x1, x2, x3, x4) etc. Think of old-fashioned vectors and matrices.
Speaking abstractly, consistency is a high value not to be given up lightly, but there are often situations, where special rules should apply to a certain "curpus separatum".
Makarius