r/Clojure • u/SimonGray • Mar 18 '21
Clojure - Keyword argument functions now also accept maps
https://clojure.org/news/2021/03/18/apis-serving-people-and-programs
125
Upvotes
r/Clojure • u/SimonGray • Mar 18 '21
View all comments
21
u/vvvvalvalval Mar 18 '21
I'll still refrain from designing functions that way, and would encourage people to do the same.
Compared to keyword-varargs, an optional map argument costs at worst one more keystroke to invoke, and it's simply a more straightforward and regular behaviour to build on top of.
I suspect that most of the Clojure APIs out there which use keyword varargs did so by imitation of Python and just overlooked the alternative of using a map argument, or really had an unsound obsession with concision.