This is the mail archive of the kawa@sourceware.org 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: calling scheme procedure from java and passing a list as argument...




On 09/17/2015 06:09 AM, Damien Mattei wrote:
hello again,
suppose i have a java code (the case is running on tomcat web server but
that's make no difference)
and i want to pass a list to a scheme routine, i have two questions:
-is there a way to call a scheme procedure in kawa,i suppose the answer
is yes but how?
( i know i can do it making a method in a kawa class definition and call
the method)

This page talks about *evaluating* Scheme from Java:

http://www.gnu.org/software/kawa/Evaluating-Scheme-expressions-from-Java.html

If you have a Scheme Proecdure object you can call by using one of the
apply methods.  For example:

   Object[] args = {x, y};
   Object result = myProc.applyN(args);
or:
  Object result = myProc.apply2(x, y);

- but how can i pass a list as parameter, what is the equivalent of
scheme list in java or kawa??
I would greatly appre"ciate a little example...

To create a list you can use one of the static methods in gnu..lists.LList,
like makeList or list1 ... list4.

It's usually best to do as much as you can in Scheme: It is easier (and
better documented with a more stable API) calling Java from Scheme
than calling Scheme from Java.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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