This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

applicability of instance? on Java array types?


> Isn't <byte[]> also a primitive type?

No.  <byte> is primitive, <byte[]> is an array (ok, it's a primitive
array) and all arrays are objects.

So, (instance? x <byte[]>) will work.

In my mind this is more a question of how the target platform functions
(i.e. the JVM).  Some things in Kawa are the way they are because that's
just how the JVM works.  In this example, instance? compiles down to the
JVM instruction 193 "instanaceof" and this instruction has specific
semantics:

http://java.sun.com/docs/books/vmspec/2nd-edition/html/Instructions2.doc6.html#instanceof

Regards,
Chris Dean


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]