5 ms·
There are plenty of hurdles in Rust, but I wouldn't call this one of them. What exactly do you expect an Iterator for a range of vectors to do?
by leshow 6y ago
There are plenty of hurdles in Rust, but I wouldn't call this one of them. What exactly do you expect an Iterator for a range of vectors to do?
- andy_ppp 6y agoTraverse the entries?
- dathinab 6y agoIt's not a range of an vector but a range which start/end are defined by vectors. The best thing I can come up with is that such a range defines a path from one tip of a (geomotric) vector to another vector and because vec in rust can have (theoretically) usize elements it's in a usize::MAX dimensional space ;=)
- leshow 6y agowe're talking about a range of vec![8,9]..vec![1,2] for example. What does 'traverse the entries' between those two values mean?
- javajosh 6y agoNot really a Rust programmer, but I would expect a Range of vectors to operate something like a vector of Ranges. So if you say [0,10]..[20, 30], the length would be twenty, and the elements would be [1,11], [2,12]... Presumably if there was asymmetry in the values like [1,10]..[20, 50] you'd end up with...something? Not really sure what it should be, there are lots of options!
- leshow 6y agoThe fact that there are options is my point: it's ambiguous. That's the reason there is no implementation for it in the std lib. You're absolutely free in Rust to define your own though.
- estebank 6y agoStep is still unstable but the point still stands.
- setr 6y agoThis seems like you'd very quickly end up with a mess of arbitrary heuristics falling over itself with seemingly mundane changes, ala excel