There is an issue in that if one tries to create a runtime class that is not in a package, it causes an error. I don't know why, nor does Russel, so until we do I suggest we add the following at the entry to jnew-runtime-class
OK, here's the patch. The simplest test case that I have works, but some of the more
complicated test cases that I have for this code are not presently working because of
recent abcl changes.
You need asm3.1 in class path for this.
I have another patch somewhere, not included here, that allows you to redefine
java classes on the fly. This is necessary if you really want to work in a lispy
style, changing things at will. I'll try to dig this up and submit it as well.
You have to manually load src/org/armedbear/lisp/runtime-class.lisp.
Here is the simplest case:
"int" ;;return type
("int" "int") ;;argument types
(lambda (x y &optional this)
(+ x y)) ;;the method itself
"/tmp/Bar.class" ;; this is optional
(let ((bar (jnew (jconstructor "FOO.Bar3"))))
(jcall (jmethod "FOO.Bar3" "a_method" "int" "int") bar 1 2))