4 ms·
It seems strange to me that `(map extract-name justice-league)` isn't listed under "idiomatic improvements." Supposing you already had `extract-name` defined f
by madmax96 8y ago
It seems strange to me that
`(map extract-name justice-league)`
isn't listed under "idiomatic improvements." Supposing you already had `extract-name` defined for some reason, it's cleaner and simpler to just map that unary function than wrap that function in an anonymous function - whether that wrapping is done with the `#(...)` reader syntax or explicitly constructed with `fn`.
- patrickthebold 8y agoOh that's a pet peeve of mine. Fun fact: it's called an eta expansion/reduction/conversion.
- fnordsensei 8y agoIt certainly looks like a deliberate move to introduce anonymous functions and thus justify replacing the named function.
- Sharlin 8y agoOr indeed `(map :name foo)` instead of the suggested (and redundant, linenoisy) `(map #(:name %) foo)`.