I’am wrapping a java lib into clojure, but i have problems dealing with variable length arguments. Say,
TestClass.aStaticFunction(Integer... intList){/*....*/}
How could i call this function in clojure?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since Java varargs are actually arrays, you can call vararg functions in Clojure by passing an array.
You could convert a Clojure seq (maybe by using Clojure’s variety of variable argument functions) into an array:
or
Or make an array and set its indices manually