Hi,
Try this:
(java.util.Arrays/asList (to-array [1 2 3 4]))
Regards,
rle
On 21.05.2015 23:08, webber wrote:
I am trying to use java.util.Arrays/asList in Clojure.
(java.util.Arrays/asList 1 2 3)
CompilerException java.lang.IllegalArgumentException: No matching method:
asList, compiling:
Hi Mauricio,
The into-array worked fine !
Thanks,
MH
> There are many things that need to be understood in a call like this.
>
> First of all, that method receives an array as its argument:
> https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#asList(T...)
>
> From your first exa
Hi Aaron,
Thank you for your reply. I was able to understand.
> Why are you trying to use Arrays#asList btw? There are probably better
ways to do what you're trying to do.
I just wanted to test reify to implement java.util.Comarator as follows:
(java.util.Collections/sort x
(reify java.util
There are many things that need to be understood in a call like this.
First of all, that method receives an array as its argument:
https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#asList(T...)
>From your first example I think you are trying to translate to clojure the
following jav
Since Arrays.asList is a variadic method, the Java compiler is magically
creating an array behind the scenes for you when you write Java code
invoking it.
Clojure does variadic functions differently for native clojure code.
To do interop with a Java variadic method have to create the array yourse
I am trying to use java.util.Arrays/asList in Clojure.
(java.util.Arrays/asList 1 2 3)
CompilerException java.lang.IllegalArgumentException: No matching method:
asList, compiling:(NO_SOURCE_PATH:1:1)
(java.util.Arrays/asList 1)
ClassCastException java.lang.Long cannot be cast to [Ljava.lang.O