This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Interaktion between Scheme and Java
On 2/22/06, Per Bothner <per@bothner.com> wrote:
>
> Pair is the wrong place to look, since converting a zero-size java.util.List
> to a Scheme list should return an empty list - which contains no Pairs.
>
> The right place to look is Pair's super-class gnu.lists.LList, which
> has the makeList convenience function:
> http://www.gnu.org/software/kawa/api/gnu/lists/LList.html#makeList(java.util.List)
However, even that doesn't work. I tried it this way as one could see
in the attachment of the last mail i wrote about.
So here are the essential steps i don't find the failure at:
scheme/TestScheme.scm:
======================
(define (theFirst list)
(car list))
Then invoking:
==============
kawa -d scheme/bin -P de.bakera.kawa. -C scheme/SchemeTest.scm
Test.java:
==========
List l = new ArrayList();
l.add("one");
l.add("two");
LList llist = LList.makeList(l);
System.out.println("Test.main() llist=" + llist);
System.out.println("Test.main() fst = "
+ SchemeTest.theFirst(llist));
output:
=======
Test.main() llist=(one two)
Exception in thread "main" java.lang.ExceptionInInitializerError
at de.bakera.kawa.SchemeTest.theFirst(SchemeTest.scm:2)
at Test.main(Test.java:36)
Caused by: java.lang.NullPointerException
at gnu.mapping.InheritingEnvironment.lookupInherited(InheritingEnvironment.java:72)
at gnu.mapping.InheritingEnvironment.getLocation(InheritingEnvironment.java:100)
at gnu.mapping.Environment.getLocation(Environment.java:117)
at gnu.expr.ModuleInfo.find(ModuleInfo.java:100)
at gnu.expr.ModuleInfo.register(ModuleInfo.java:115)
at kawa.lib.lists.<init>(lists.scm)
at kawa.lib.lists.<clinit>(lists.scm)
... 2 more
I don't know how to interpret the output. Does anyone perhaps has any
suggestions about this problem? Or just a simple step-by-step tutorial
to teach kawa figuring out about symbols?
Thanks for ANY help and greetings from germany,
Marco.
--
,----[ /X\arco -- www.bakera.de ]----
| (Y F) = (F (Y F))
`----[ www.bulb-publications.de ]----