3 ms·
> There are cases where functional programming can be a lot terser (for better and worse), but I don't think this is one of them. That's only true in Go becaus
by pcwalton 13y ago
> There are cases where functional programming can be a lot terser (for better and worse), but I don't think this is one of them.
That's only true in Go because Go doesn't have type inference for closures. In ML for example this would be:
let output = map (fn i -> convert i) input
or, more succinctly:
let output = map convert input
- cmccabe 13y agoYes, that's true. I just wanted to address the specific suggestion that the original author made. Languages make a whole set of related design choices and typically none of them makes sense without considering the others. (Sometimes none of them makes sense AFTER considering the others, but that's another story.)