Hacker News new | ask | show | jobs
by krat0sprakhar 3794 days ago
> Clojure example really gives you no information what's happening behind the scenes.

I respectfully disagree. Map is almost a universal function and IMO, anyone who knows about map will instantly grok what the Clojure version does. The reason this looks so simple in Clojure is due to the fact that the map function is variadic (as our most other functions in Clj) but that is clearly not magic for any experienced programmer.

1 comments

I respectfully disagree. I know map, of course, yet clojure (or LISPs in general) is the only language where it is variadic. I definitely did not instantly grok what the Clojure version does - in fact, I know all the languages in the example and each of them was more clear than clojure to me
> I know map, of course, yet clojure (or LISPs in general) is the only language where it is variadic.

According to Wikipedia `map` is also variadic in in D, in J, in Mathematica, in Prolog (and logtalk), in Python and in R (to an extent, `lapply` is not variadic but `mapply` can take 2+ sequences).

Variadic map is by no means limited to lisps.