From: Peter Graves <peter@ar...> - 2007-11-02 00:38:34
On Thu, 1 Nov 2007 at 22:38:49 +0100, Marco Antoniotti wrote:
> You are saying that I could write something like
> (defun eval-escaping-to-java (exp)
> (eval exp)
> (error (e)
> "CLConditionSignaler.singnalToJava" e))))
> In order to get what I want?
Sort of, but I'm not sure you want to pass the CL condition object
directly to Java. (You might be able to do this, since a LispObject is,
after all, a java.lang.Object, but I'm not sure what your Java code
would do with it.)
Something like the following, which constructs a Java string and passes
it to CLConditionSignaler.signalToJava(), has a better chance of
actually working (but I haven't tested it):
(defun eval-escaping-to-java (exp)
(let* ((constructor (java:jconstructor "java.lang.String"
(message (java:jnew constructor "condition signalled!")))
(java:jstatic "signalToJava" ; method
"CLConditionSignaler" ; class
Someone with relevant experience can probably suggest a more elegant
I recommend tests/java-tests.lisp for examples of ABCL's Java API, and
of course the source in Java.java and java.lisp.
Get latest updates about Open Source Projects, Conferences and News.