Getting a Java class from Function.execute (LispObject introspection)

Frederico Munoz fsmunoz at
Tue Apr 25 10:57:17 UTC 2017


Solved it help from ferada in the IRC channel, it's trivial now that I
look at it but I'll leave it here anyway, maybe it helps someone.

Frederico Munoz <fsmunoz at> wrote:
> I have one doubt regarding LispObject (what we get from
> Function.execute): I have read some introspection in the manual but my
> use-case is slightly different since the I will use the return value of
> the Lisp call and that value is actually a Java class (from a
> non-standard library which I use) that will be the return value of the
> main method of the Main class.

Assuming somethins like this in the Lisp file:

(defun say-hello (&optional name)
  (let ((response (java:jnew "")))
... this works from the Java side:

LispObject result = voidFunction.execute(new JavaObject(thisObject));
JavaObject jo = ((JavaObject) result);
JsonObject json = ((JsonObject) jo.getObject());
json.addProperty("greet", "Hi!");
// => "Hi!"
System.out.println("Class: "  + json.getClass().getName());
// => Class:

Best regards,
fsmunoz at
SDF Public Access UNIX System -

More information about the armedbear-devel mailing list