[armedbear-devel] Passing lisp objects from java to lisp
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? Thanks. Blake McBride
On Sun, Jan 24, 2010 at 2:35 AM, Blake McBride <blake@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 hth, Alessio
participants (2)
-
Alessio Stalla
-
Blake McBride