Re:D as a Better C
by christophilus on Wednesday August 23, 2017 @02:25PM
(#15083859)
I understand. That's why I mention it as one of the downsides of D. It's probably subjective, but I like to see the types of function signatures. It serves as documentation, and makes it easier for me to say, "What does this function return, and what can I do with it?"
[ Parent
| on HN ]
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.