I am searching the API for handling the values in Armed Bear Common Lisp (ABCL) implementation of the Common Lisp language in the JVM, using Java.
It works when a function returns (only) a list or a string.
When it returns multiple values I only can fetch the first returned value.
I do not know how to fetch the other values.
This is my test.lisp file :
(defun get-list ()
(list "abc" 12 'a 'b))
(defun get-value ()
(values "abc" 12 'a 'b))
And my Java code is :
public static void main(String[] args) throws Exception {
Interpreter interpreter = Interpreter.createInstance();
LispObject lobj = interpreter.eval("(load \"test.lisp\")");
org.armedbear.lisp.Package defaultPackage = Packages.findPackage("CL-USER");
Symbol myFunctionSym = defaultPackage.findAccessibleSymbol("GET-LIST");
Function myFunction = (Function) myFunctionSym.getSymbolFunction();
LispObject o = myFunction.execute();
System.out.println(o.listp()); // this return false
Symbol myFunctionSym2 = defaultPackage.findAccessibleSymbol("GET-VALUE");
Function myFunction2 = (Function) myFunctionSym.getSymbolFunction();
LispObject o2 = myFunction.execute();
}