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]

Inter-operating with Java lists


I have a list of Java objects in a Java list (e.g. java.util.ArrayList).

I have a scheme function that takes a Scheme list as a parameter.

How do I pass my Java list to the scheme function?

(In my scheme function I want to treat the list as a Scheme list so that I
can invoke 'car' and 'cdr' on it.)

I tried creating a new Pair() object in my Java code, adding my Java objects
to it (using the 'add' method since Pair implements the List interface), and
passing it as an argument to the scheme function. I get the following
exception:

   'java.lang.UnsupportedOperationException: gnu.lists.Pair does not
implement addPos

-Shoeb






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