[armedbear-devel] Passing lisp objects from java to lisp

Alessio Stalla alessiostalla at gmail.com
Thu Feb 11 20:01:11 UTC 2010

On Sun, Jan 24, 2010 at 2:35 AM, Blake McBride <blake at arahant.com> wrote:
> Greetings,
> If I have a lisp function as follows:
>     (defun myfun (a b)
>         (+ a b))
> I want to be able to call it from lisp or java.  In other words I don't want
> the lisp side to have to use jobject-lisp-value.
> Therefore, from the java side, how do I take a java object and translate
> into a lisp object so that when I call the execute method the lisp function
> doesn't need jobject-lisp-value?

JavaObject.getInstance(javaObj, true)

You also have the option to use the JSR-223 API that does Java<->Lisp
conversions for you:

Invocable invocable = (Invocable) lispEngine; //obtained like in the
abcl examples
invocable.invokeFunction("pkg:myfun", 12, 34); //returns 46


More information about the armedbear-devel mailing list