Expand a vector into the arguments of a function

后端 未结 1 1967
轮回少年
轮回少年 2021-01-01 10:05

Is there a way to expand a vector of values into the arguments of a function? e.g. something like this:

(defn addnums [a b]
  (apply + (flatten [a b])))

(de         


        
相关标签:
1条回答
  • 2021-01-01 11:06

    You can just use apply again:

    (apply addnums args)
    
    0 讨论(0)
提交回复
热议问题