This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unbound scheme procedures when calling from Java


> >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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]