This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: calling scheme from java
- From: William Shulman will <will at mercedsystems dot com>
- To: "Hurst, Dave" <DHurst at lisletech dot com>, "'kawa at sources dot redhat dot com'" <kawa at sources dot redhat dot com>
- Date: Thu, 03 Aug 2006 14:41:54 -0700
- Subject: Re: calling scheme from java
If you define your function as a method inside a class using
define-simple-class (i.e. in scheme), it is very easy to call from java.
But, your function will not be a top-level procedure, it will be a method
inside a class.
-will
> From: "Hurst, Dave" <DHurst@lisletech.com>
> Date: Thu, 3 Aug 2006 12:04:35 -0500
> To: "'kawa@sources.redhat.com'" <kawa@sources.redhat.com>
> Subject: calling scheme from java
>
> Hello!
>
> Is it possible to call Scheme functions from Java so that I can pass Java
> objects as arguments to the function? Evaluating a Scheme expression using
> Scheme.eval() won't work because there's no way to pass a Java object
> through a string containing a Scheme expression.
>
> For example, suppose I have a function defined like this:
>
> (define (my-func collection :: <java.util.Collection>)
> ... do something with collection ... )
>
> I would like to call my-func from Java and pass it a Collection instance.
>
> --DaveH "Be Excellent to each other!"