Re:The Beauty of Clojure
by diego on Wednesday August 26, 2015 @02:29AM
(#10121398)
(comp inc inc) is weird. You'd normally use #(+ 2 %) or (partial + 2) instead.
[ Parent
| on HN ]
Yeah, definitely. My bad. It's definitely not idiomatic.
I think was trying to avoid using the anonymous fn syntax, as I thought that was be more off-putting, and partial hadn't occurred to me at the time. In the end, I think I just confused the issue.
In retrospect, I should probably have used a totally different example, and avoided map and reduce as they are FP idioms. Live and learn, as they say.