This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Unbound scheme procedures when calling from Java
- From: Chris Dean <Chris dot Dean at sokitomi dot com>
- To: Vladimir Tsichevski <wowa at jet dot msk dot su>
- Cc: Esko Nuutila <enu at peak1 dot cs dot hut dot fi>, kawa at sources dot redhat dot com, esko dot nuutila at hut dot fi
- Date: Mon, 31 Mar 2003 11:12:16 -0800
- Subject: Re: Unbound scheme procedures when calling from Java
- References: <200303311237.h2VCbX99005515@peak1.cs.hut.fi> <3E886104.3030900@jet.msk.su>
> >We are trying to call our own Scheme procedures from Java.
Another way to do it is to get a ModuleMethod and call that from Java.
This will work no matter what the setting of module-static:
import kawa.standard.Scheme;
import gnu.mapping.Environment;
import gnu.expr.ModuleMethod;
import gnu.math.IntNum;
public class TestExpr2 {
public static final String CLASS_VERSION
= "$Id$";
static public void main( String args[] ) throws Throwable {
Scheme.registerEnvironment();
Environment env = Environment.getCurrent();
Scheme.eval( "(load \"Small\")", env );
ModuleMethod test = (ModuleMethod) env.get( "test", null );
System.err.println( "test = " + test );
System.err.println( "result = " + test.apply0() );
}
}
Regards,
Chris Dean