Re:D as a Better C
by ben-schaaf on Wednesday August 23, 2017 @11:20PM
(#15087366)
The problem is, with a lot of the range code in D you can't actually specify the return type since it's an internal struct or similar.
Seeing MapResult!R map(R, alias fn)(R range) makes it seem like MapResult is a thing you can reference/use. But it's an internal struct, so it's neither accessible not documented. That's a whole lot more confusing than having auto and documenting that the result is an input range.
Seeing MapResult!R map(R, alias fn)(R range) makes it seem like MapResult is a thing you can reference/use. But it's an internal struct, so it's neither accessible not documented. That's a whole lot more confusing than having auto and documenting that the result is an input range.