Java array class is not kawa Class?

Jim White jim@pagesmiths.com
Sun Mar 2 20:14:00 GMT 2008


Yaroslav Kavenchuk wrote:

> 2008/3/1, Jim White wrote:
> 
>> So I fiddled around and suggest this:
>>
>> #|kawa:9|# (java.lang.Class:isArray (integer[] 1 2):class)
>> true
>> #|kawa:10|# (java.lang.Class:getComponentType (integer[] 1 2):class)
>> class gnu.math.IntNum
>>
>> Dealing with primitive types is a bit fussier:
>>
>> #|kawa:24|# (instance? (java.lang.Class:getComponentType (int[] 1
>> 2):class) <java.lang.Class>)
>> true
>> #|kawa:25|# (java.lang.Class:getComponentType (int[] 1 2):class)
>> int
>> #|kawa:26|# (instance? (java.lang.Class:getComponentType (int[] 1
>> 2):class) <java.lang.Class>)
>> true
>> #|kawa:27|# (java.lang.Class:isPrimitive
>> (java.lang.Class:getComponentType (int[] 1 2):class))
>> true
>> #|kawa:29|# (eq? (java.lang.Class:getComponentType (int[] 1 2):class)
>> java.lang.Integer:TYPE)
>> #t
> 
> 
> Oops, I not guessed use the 'native' methods:
> 
> #|kawa:24|# (*:getMethods java.lang.Class)
> ...
> public native java.lang.Class java.lang.Class.getComponentType()
> ...
> 
> as static. Many-many thansk!
> 
>>Did it work?
> 
> Yes! But... very slowly. Especially startup (initialization).

Yeah, the first thing evaluated has to load Groovy and compile the Wings 
macro.  Also prior to 0.4 (available by doing "Update" in the 
"Tools:Extensions..." dialog if you've installed 0.3) the compiled 
macros weren't cached.  And of course OpenOffice uses a lot of resources.

But once initialized, GroovyForOpenOffice performance just depends on 
your JVM.

>> If have trouble and/or success please do let me know on the IFCX forum.
> 
> I wrote: http://sourceforge.net/forum/message.php?msg_id=4573444   :)

Ah yes!

>... 
> What you think about JavaFX?

No reason to live.  ;-)

It does have static typing with type inference so performance is good, 
but it has funky syntax and so is not better than Jython or JRuby and 
for folks who like those features there is Scala.  It does have a nifty 
binding mechanism, but other languages will be getting that too (there's 
a JSR for it).  The only people likely to buy in to JavaFX are the Java 
ME cell phone licensees.

I am pleased to see that Sun has recognized that Java needs to work as 
well as Flash if it is going to win back a bit of the web browser/rich 
client territory (which initially was given completely and freely to 
Java by Netscape, but then bungled by McNealy and Sun marketroids).

But the best thing about JavaFX is that it caused Sun to hire Per!  :-)

Jim



More information about the Kawa mailing list