3 ms·
Are you sure that is a list, and not something else, like a tuple?
by kazinator 12y ago
Are you sure that is a list, and not something else, like a tuple?
- dllthomas 12y agoIt's precisely a tuple, obviously. Are you sure you said "list", not "heterogeneous collection"? If you know what is where in the list, then you semantically have a tuple. If you don't know what is where in the list, then you need some way of telling things apart. At which point an ADT is frequently the right solution, isn't any sort of advanced technique, and requires very little in the way of boilerplate.