From the 1.3 docs:
;; Currently Clojure does not permit type hints of arrays, e.g. ^ints as
;; argument types or return types in a definterface. This may be enhanced
;; later.
Jim
ps: also, non-primitive arrays are hinted like this if I'm not mistaken:
#^"[Ljava.lang.String;"
On 09/10/13 13:55, Qiu Xiafei wrote:
Clojure provide built-in type hint for primitive types such as: ^ints,
^doubles, but how to type hint an array of arbitrary Class?
The following way dosn't work, too:
user=> (definterface MyInterface
#_=> (^"[Ljava.lang.String" method1 []))
user.MyInterface
user=> (.method1 (reify MyInterface (^"[Ljava.lang.String;" method1
[this] )))
CompilerException java.lang.NoClassDefFoundError: [Ljava/lang/String,
compiling:(NO_SOURCE_PATH:1:11)
thanks!
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.