This is the mail archive of the kawa@sourceware.org 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]

Re: Java array class is not kawa Class?


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).

>  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   :)

>  > Why did you choose Groovy rather than Kawa or Clojure?
>
>
> Groovy has very compact syntax for doing things with Java classes and
>  collections and I think it is the best of the currently hot "scripting"
>  languages (JRuby, Jython, and Groovy) for people who already know Java.

What you think about JavaFX?

>  Since I've been a Lisper for about 30 years now I've come to accept that
>  folks are never gonna get excited about a language with TMDRP (Too Many
>  Damned Right Parenthesis).  While resurrecting UCI MLISP or porting
>  Dylan to Kawa are both interesting possibilities, I'm more interested in
>  applications of such things these days.

I very glad to hear it :)

>  My plans for IFCX Wings include supporting any programming language,
>  starting with those that work on the JVM, and I have a hacked up version
>  that shows both Groovy and Scheme (Kawa) in the same document.

Good luck!

-- 
WBR, Yaroslav Kavenchuk.


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