by mseepgood · 14y ago · 0 comments
Essential: no.
Map/Filter introduce several new semantic concepts to a language. I think they were avoided for simplicity's sake and the fact you can achieve the same result with a for loop, even if it is slightly less concise.
No they don't. If you already have first-class functions (Go does) and some sort of sequence type (Go does), you have map/filter. There's no new semantic concepts.
The only added simplicity here is for the compiler writers, not the end users.
for i, n := range numbers { numbers[i] = n * n }
Sorry, but I do not see a difference in the order of assembly language vs. high-level language.
https://github.com/tcard/functional
I can't say I've actually needed to use map or filter. You can, much as people did for the last 30 years and still do with C, quite happily do this sort of stuff with a for loop...