How to make a Clojure function take a variable number of parameters?

后端 未结 5 1622
闹比i
闹比i 2020-12-08 05:57

I\'m learning Clojure and I\'m trying to define a function that take a variable number of parameters (a variadic function) and sum them up (yep, just like the + pro

5条回答
  •  萌比男神i
    2020-12-08 06:24

    defn is a macro that makes defining functions a little simpler. Clojure supports arity overloading in a single function object, self-reference, and variable-arity functions using &

    From http://clojure.org/functional_programming

提交回复
热议问题