3 ms·
Alright, if it's not too much trouble, can you show me what the equivalent of the following code would be in Go? I think this is extremely clear as-is, but I'd
by creata 5y ago
Alright, if it's not too much trouble, can you show me what the equivalent of the following code would be in Go? I think this is extremely clear as-is, but I'd love to see how you can apparently make it even clearer by avoiding iterator combinators.
https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=fbb03d43417b13234c9146c6a205f6c2 https://play.rust-lang.org/?version=nightly&mode=release&edi...
- throwaway894345 5y agoPersonally I think this is clearer, but it's quite contrived either way: https://play.golang.org/p/FpUWwm5yZ8n https://play.golang.org/p/FpUWwm5yZ8n
- creata 5y agoNice! Out of curiosity, if the iterators weren't of the same type (e.g. one was an iterator over the values of a hashmap and the other was over the items in a list) what would you have used instead of for _, m := range maps { ... }?
- coder543 5y agoIf you could provide the hypothetical Rust code you're referring to, that would probably make your question more clear here. I know both Rust and Go rather well, and I'm confused about which direction you're wanting to take the code.
- throwaway894345 5y agoJust as with Rust, you'd have to convert both maps to the same type before you could iterate them over together (or chain them, in Rust).