This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

module-implements


Hey Per, am I missing something, or does module-implements not work?

$ cat test/MyActionListener.scm
(module-compile-options warn-undefined-variable: #t
                        warn-invoke-unknown-method: #t)
(module-static #f)
(module-implements java.awt.event.ActionListener)
(module-export action-performed)

(define (action-performed (e :: java.awt.event.ActionEvent))
(display e) (newline))
$ java -cp ../kawa-1.10.jar:. kawa.repl -C test/MyActionListener.scm
(compiling test/MyActionListener.scm to test.MyActionListener)
$ javap test.MyActionListener
Compiled from "MyActionListener.scm"
public class test.MyActionListener extends gnu.expr.ModuleBody implements java.lang.Runnable{
public final gnu.expr.ModuleMethod action$Mnperformed;
static final gnu.mapping.SimpleSymbol Lit0;
public test.MyActionListener();
public void actionPerformed(java.awt.event.ActionEvent);
public final void run(gnu.mapping.CallContext);
public static {};
public int match1(gnu.expr.ModuleMethod, java.lang.Object, gnu.mapping.CallContext);
public java.lang.Object apply1(gnu.expr.ModuleMethod, java.lang.Object);
}

Regardless of where in the file I put the "(module-implements java.awt.event.ActionListener)" line, the resultant class only ever implements java.lang.Runnable.


Also, the documentation says that if there is a module-implements declaration, then (module-static #f) is implied.
But if I remove the explicit "(module-static #f)" and recompile, then actionPerformed() and action$Mnperformed are static:


$ javap test.MyActionListener
Compiled from "MyActionListener.scm"
public class test.MyActionListener extends gnu.expr.ModuleBody implements java.lang.Runnable{
public static gnu.expr.ModuleMethod action$Mnperformed;
static final gnu.mapping.SimpleSymbol Lit0;
public test.MyActionListener();
public static void actionPerformed(java.awt.event.ActionEvent);
public final void run(gnu.mapping.CallContext);
public static {};
public int match1(gnu.expr.ModuleMethod, java.lang.Object, gnu.mapping.CallContext);
public java.lang.Object apply1(gnu.expr.ModuleMethod, java.lang.Object);
}


I don't see any test cases in trunk/testsuite, so I imagine module- implements has never left the experimental stage.

Thanks,
Jamie

--
Jamison Hope
The PTR Group
www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]