Hacker News new | past | comments | ask | show | jobs | submit login

(comp inc inc) is weird. You'd normally use #(+ 2 %) or (partial + 2) instead.



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.


  (reduce + (map (partial + 2) (range 10)))
...reads great in my opinion. Surprised no one else has brought it up.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: