Basically question says it all.
When I declare a function signature in gen-class, what type do I put for a 2D array of strings?
[myFunc [XXXX] ReturnType]
what do I put for XXXX?
Update : following @Mark Topolnik's suggestion, I'm trying
#^{:static true} [myFunc [ ^"[[Ljava.lang.String;" ] clojure.lang.IFn]
in my declaration, and I'm getting back a
java.lang.RuntimeException: Unmatched delimiter: ]
runtime exception when I try to compile it.
Update 2 : Fixed by removing the ^ from the above line. (This is in the context of declaring function signatures in a gen-class so that ^ is presumably unnecessary.)
Multidimensional array types have no direct support in Clojure, but you can always fall back to using a String with the binary type name. In your case, this would look like the following:
[myFunc ["[[Ljava.lang.String;"] ReturnType]
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