4 ms·
This proposal seems pretty bad to me. I think Go lacks the features to make this ergonomic and flexible. Before adding iterators the language should add tuple
by veber-alex 3y ago
This proposal seems pretty bad to me.
I think Go lacks the features to make this ergonomic and flexible.
Before adding iterators the language should add tuples so that you won't need to special case 0,1 and 2 artity functions.
And shorter syntax for anonymous functions to make writing this less verbose, I believe this has been proposed before.
Also the special case for "0..N" ranges seems very unnecessary.
- mutatio 3y agoI was thinking exactly this. Coming from Rust, but also as a fan of Go, I can't help that the building blocks just aren't there to construct a satisfying form of iterators, and like you said that would be language support for tuples and expanding the flexibility of Go's generics for methods to support the composition Rust allows, such as: iter.skip(10).take(10).map()...