<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Is there a way to implement multiple interfaces on a single Java proxy? This code almost works:<br></div><div><br></div><div dir="ltr" data-setdir="false"><div><font face=""lucida console", sans-serif">(java:jinterface-implementation<br> "org.apache.spark.api.java.function.Function"<br><br></font><div><font face=""lucida console", sans-serif"> "call" (lambda (s) (length s)))</font></div><div><br></div><div dir="ltr" data-setdir="false">except that the proxy also needs to implement Serializable. The <a href="https://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/java.lisp#L118">jproxy code</a> in java.lisp seems to suggest that multiple implementations are allowed:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div><font face=""lucida console", sans-serif"><span class="ydp74b63e00p">(</span><span class="ydp74b63e00nb">defgeneric</span> <span class="ydp74b63e00nv">jmake-proxy</span> <span class="ydp74b63e00p">(</span><span class="ydp74b63e00nv">interface</span> <span class="ydp74b63e00nv">implementation</span> <span class="ydp74b63e00k">&optional</span> <span class="ydp74b63e00nv">lisp-this</span><span class="ydp74b63e00p">)</span></font></div><div><font face=""lucida console", sans-serif"><span class="ydp74b63e00p"> (</span><span class="ydp74b63e00ss">:documentation</span> <span class="ydp74b63e00s">"Returns a proxy Java object implementing the provided interface(s)...</span></font></div><div><span class="ydp74b63e00s"><br></span></div><div dir="ltr" data-setdir="false"><span class="ydp74b63e00s">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.<br></span></div><div dir="ltr" data-setdir="false"><span class="ydp74b63e00s"><br></span></div><div dir="ltr" data-setdir="false"><span class="ydp74b63e00s">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.</span></div><div dir="ltr" data-setdir="false"><span class="ydp74b63e00s"><br></span></div><div dir="ltr" data-setdir="false"><span class="ydp74b63e00s"><br></span></div><div><br></div></div></div><div><br></div></div></div></body></html>