On 24 Mar, 17:54, Alan wrote:
> On Mar 24, 9:47 am, Alessio Stalla wrote:
>
> > Reflection is aware of generic type
> > variables:http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Generi...
>
> > What is lost at runtime is information about *instantiation* of those
> > variables: e.
cool :-)
I had a feeling that there was some vestige of generics left at runtime -
now I know exactly what it is.
thanks guys,
Jules
--
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
On Mar 24, 9:47 am, Alessio Stalla wrote:
> Reflection is aware of generic type
> variables:http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Generi...
>
> What is lost at runtime is information about *instantiation* of those
> variables: e.g. you can't distinguish a method returning
Thanks Andy,
I agree that there is no practical remnant of generics in the runtime as I
have poked around with reflection as well, but I think there might be in the
bytecode, otherwise if I compiled a generic interface, stuck it into a jar
and gave it to you to link against, the compiler would
This is only half-true. The data exists somewhere, as Jules says, so
that javac can enforce proper use of generics when calling compiled
library code. Eg, rt.jar contains only classes, yet j.u.List still
manages to have generics, which are treated correctly by the compiler.
The *use* of generic cod
On Thursday, March 24, 2011 5:29:56 PM UTC+1, Jules wrote:
>
> Thanks Andy,
>
> I agree that there is no practical remnant of generics in the runtime as I
> have poked around with reflection as well, but I think there might be in the
> bytecode, otherwise if I compiled a generic interface, stuck
I'm not an expert on this, but I believe that whenever you have generics in
Java, they have no effect on the bytecode, e.g. a HashMap has
the same type in the bytecode as any other HashMap. The part
is only used in some checks made by the Java compiler when compiling Java
source code, and in
Thanks for the reply Armando,
This is pretty much where i was until I was asked to write a dot.net client
library for my server.
I then looked at all my Java code and figured I could write a second copy in
C# and then keep the two in sync for ever after, or port it all to Clojure
and let Cloju
For interop I write interfaces in Java. This way I can provide type-
specific signatures, constants, javadocs and generics; then implement
them all in Clojure. I also write exception classes in Java for use in
Clojure since I find it simpler and cleaner than gen-class. You don't
have to give up any
Guys,
I have a hybrid Java/Clojure project.
The Java side contains a number of interfaces/classes that make use of
generics.
Implementing the interfaces Clojure-side is no problem - I just forget about
type and get on with it :-)
I am slowly migrating more and more code into Clojure and there
10 matches
Mail list logo