Re: Interop question concerning optional args

2012-12-11 Thread Andy Fingerhut
There is a ticket filed for it, in case some contributor wants to update the patches for it. It got intertwined with CLJ-445's patch, which hasn't been updated in a while, so you might want to start fresh rather than untangle the history there. http://dev.clojure.org/jira/browse/CLJ-440 Andy

Re: Interop question concerning optional args

2012-12-11 Thread Vladimir Tsichevski
I found this (mis)feature quite annoying too. I think, we all shall ask the language authors to fix it. On Tuesday, December 11, 2012 10:44:34 AM UTC+4, Andy Fingerhut wrote: > > You can pass in a length 0 array of > java.nio.file.attribute.FileAttribute's like so: > > (java.nio.file.Files/creat

Re: Interop question concerning optional args

2012-12-10 Thread Andy Fingerhut
You can pass in a length 0 array of java.nio.file.attribute.FileAttribute's like so: (java.nio.file.Files/createTempDirectory "mytempname" (make-array java.nio.file.attribute.FileAttribute 0)) Andy On Dec 10, 2012, at 8:54 PM, Dave Kincaid wrote: > I just came across this same problem while

Re: Interop question concerning optional args

2012-12-10 Thread Dave Kincaid
I just came across this same problem while trying to use Java 7's java.nio.file.Files.createTempDirectory() (http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempDirectory(java.lang.String, java.nio.file.attribute.FileAttribute...)) Clojure won't let me just do (java.nio

Re: Interop question concerning optional args

2010-09-27 Thread ataggart
The vararg at the end of the method is just syntactic sugar for an array, so the "add" method actually takes 4 args, the last being a Resource array. The java compiler just replaces "missing" varargs with an empty array. My guess is that the reflection mechanisms in the compiler just look at type