Skip to content

Why do tuples start from Item1 #8539

Answered by koszeggy
zms9110750 asked this question in Q&A
Discussion options

You must be logged in to vote

We subconsciously assume that all parameters start from 0.

Those are not parameters or indexed members but fields with explicit names.

When we were learning arrays, we learned that computer counting starts from 0.

When you access the fields by the ITuple[int] indexer the indexing starts from 0 and it's also documented:

The index of the specified Tuple element. index can range from 0 for Item1 of the Tuple to one less than the number of elements in the Tuple.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zms9110750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants