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])))
(def args [[1 2 3] [1 2 3]])
(addnums *args)
You can just use apply
again:
(apply addnums args)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With