source: trunk/j/examples/abcl/javacall_from_lisp/lispfunctions.lisp @ 11382

Last change on this file since 11382 was 11382, checked in by vvoutilainen, 13 years ago

Examples for using abcl, initial commit.

File size: 689 bytes
1; we need to get the
2; 1) class (Main)
3; 2) classes of the parameters (int)
4; 3) method reference (getting that requires the class
5; of our object and the classes of the parameters
7; After that we can invoke the function with jcall,
8; giving the method reference, the object and the parameters.
9; The result is a lisp object (no need to do jobject-lisp-value),
10; unless we invoke the method
11; with jcall-raw.
12(defun void-function (param)
13  (let* ((class (jclass "Main"))
14   (intclass (jclass "int"))
15   (method (jmethod class "addTwoNumbers" intclass intclass))
16   (result (jcall method param 2 4)))
17    (format t "in void-function, result of calling addTwoNumbers(2, 4): ~a~%" result)))
Note: See TracBrowser for help on using the repository browser.