Nicolas Martyanoff on Nostr: The #Go slices package makes common operations much more compact, this is good. If ...
The #Go slices package makes common operations much more compact, this is good. If you're still using 1.20 or older (what's your excuse?), you can use golang.org/x/exp/slices instead.
But there is no Map method. Or Filter (which should always be two functions, Select and Reject). Or Fold. They were proposed more than 2y ago and of course rejected by Go developers because they should be part of a "stream API" (???) which of course never manifested. As it was for packages, it is going to take years to get what is standard in most sane languages.
But there is no Map method. Or Filter (which should always be two functions, Select and Reject). Or Fold. They were proposed more than 2y ago and of course rejected by Go developers because they should be part of a "stream API" (???) which of course never manifested. As it was for packages, it is going to take years to get what is standard in most sane languages.