3 ms·
The base interface for tuples is useful, that's how I did tuples in my Sasa library years ago. Can't say I see the need to index a tuple dynamically with an in
by naasking 9y ago
The base interface for tuples is useful, that's how I did tuples in my Sasa library years ago.
Can't say I see the need to index a tuple dynamically with an integer, or to access a tuple as an object[]. What's the use case for this?
- garganzol 9y agoA lot of JavaScript color manipulation libraries use arrays to represent a color. Like c[0] = R, c[1] = G, c[2] = B. .NET ports of such libraries can be hugely improved by using value tuples for color representation, while keeping the original array-based semantics.
- naasking 9y agoBut why keep the original array-based semantics if you're using a tuple? In fact, I'm not even sure why you'd use a ValueTuple for that at all, because it's not a tuple but more of a vector type because the elements are all of the same type. You'd probably want a more meaningful domain-specific type.