This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: calling kawa functions from java (FFI)
- From: Bruce Lewis <brlewis at ALUM dot MIT dot EDU>
- To: "Mato Mira, Fernando" <Fernando dot Matomira at dialog dot com>
- Cc: "'kawa at sources dot redhat dot com'" <kawa at sources dot redhat dot com>
- Date: 05 Jun 2003 09:27:12 -0400
- Subject: Re: calling kawa functions from java (FFI)
- References: <F4FDFA2571F2464EBCBCC8B12AED3E57011E19A8@CHBEMAIL1>
"Mato Mira, Fernando" <Fernando.Matomira@dialog.com> writes:
> How does one call kawa functions from Java? That is, not using
> Scheme.eval. I have some
> Scheme objects stored in Java variables that I need to pass to the function.
You have to use Scheme.eval once, like this:
import gnu.mapping.*;
Procedure request_handler = (Procedure) interp.eval(handler_name);
Then, use the appropriate method from gnu/mapping/Procedure.java as many
times as you wish, e.g. for a two-argument function:
request_handler.apply2(obj1, obj2)
--
<brlewis@[(if (brl-related? message) ; Bruce R. Lewis
"users.sourceforge.net" ; http://brl.codesimply.net/
"alum.mit.edu")]>