Apologies, when I said "but I can't see adding multiple implementations", I meant multiple interfaces.

On Thursday, July 30, 2020, 11:19:07 AM GMT+8, Steven Nunez <steve_nunez@yahoo.com> wrote:


Is there a way to implement multiple interfaces on a single Java proxy? This code almost works:

(java:jinterface-implementation
 "org.apache.spark.api.java.function.Function"

 "call" (lambda (s) (length s)))

except that the proxy also needs to implement Serializable. The jproxy code in java.lisp seems to suggest that multiple implementations are allowed:

(defgeneric jmake-proxy (interface implementation &optional lisp-this)
  (:documentation "Returns a proxy Java object implementing the provided interface(s)...

but I can't see adding multiple implementations in the code. I see there's a few jmake-proxy methods in there though: are there any documentation or examples for their usage? Lsw2 doesn't use this at all and I can't find any other good examples of using ABCL.

Multiple interfaces from the jinterface-implementation function would be ideal, as the above code could then be wrapped with a macro to produce a 'spark-lambda' and be used nearly like the regular ABCL lambda.