This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Inter-operating with Java lists
- From: "Bhinderwala, Shoeb" <SBhinderwala at wellington dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Mon, 22 Sep 2003 09:52:34 -0400
- Subject: 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