Just ignore the generics. When you say in Java:
BlockingQueue<Long> q = new BlockingQueue<Long>();
you just say in Clojure:
(def q (BlockingQueue.))
Sincerely
Meikel
I think your conclusion is correct.
Here's an example with java.lang.Class and clojure.contrib.repl-utils/
show:
The Java 1.5 docs for Class.asSubClass show that it takes a generic as
an argument and returns a generic:
<U> Class<? extends U> asSubclass(Class<U> clazz)
Casts this Class object to represent a subclass of the
class represented by the specified class object.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html
Compare that with the reflection info shown by clojure.contrib.repl-
utils/show:
user=> (show Class)
=== public final java.lang.Class ===
[ 0] static forName : Class (String)
[ 1] static forName : Class (String,boolean,ClassLoader)
[ 2] asSubclass : Class (Class)
[...]
nil
user=> (show Class 2)
#<Method public java.lang.Class
java.lang.Class.asSubclass(java.lang.Class)>
This shows that the entry point is at some level "really" expecting a
Class and returning a Class.
I've done this in practice in a different context and it worked fine.
--Steve
Yeah, that makes sense. Thanks!