This is the mail archive of the
mailing list for the Kawa project.
Re: Exception when calling fn. using for-each in Java
- To: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Subject: Re: Exception when calling fn. using for-each in Java
- From: Per Bothner <per at bothner dot com>
- Date: 19 Dec 2000 11:22:43 -0800
- Cc: kawa at sourceware dot cygnus dot com
- References: <Pine.LNX.email@example.com>
Jocelyn Paine <firstname.lastname@example.org> writes:
> Now, this is NOT because I've passed a null parameter to pairToVector:
> the same exception also happens if I construct a Kawa list and pass that.
> By compiling various Kawa functions and calling from Java, I've discovered
> that it's the presence of a for-each in the function that provokes this
> error, whether or not it is acting on objects passed from Java. But such
> functions work OK when called from Kawa.
> Tentative hypothesis: when Kawa compiles a 'for-each', it generates some
> kind of initialisation code which needs to be executed when the function
> is called for the first time. This is automatic when calling from Kawa,
> but not from Java. Any suggestions?
It has nothing to do with for-each per se. However, you need a
Scheme environment for the Scheme code it work. You should add:
to the start of main. This is documented in the Kawa manual,
though it may be easy to overlook, because of lack of examples.