Re: Question about ABCL conditions and Java Exceptions



MA> sorry for the noise, but I need a quick answer from the ABCL
MA> developers. I tried the mailing list, but the responses are not
MA> coming (*).

i do not see you message on gmane, probably you need to register on
sourceforge's mailing lists or something.

MA> I would like to embed ABCL in a Java program. My question is about
MA> conditions and exceptions. I understand that I can evaluate a CL
MA> expression calling the appropriate Java method, but I have not figured
MA> out how a call to ERROR would be handled.
MA> Better: it seems to me that I have no way to get a Java exception
MA> (optimal situation) or an error code in the embedding Java out of such
MA> call.

no, eval (and many other functions in ABCL) can throw ConditionThrowable:

Interpreter.java:
public LispObject eval(String s) throws ConditionThrowable


Peter posted a code on mailing list about a month ago:

try
{
Interpreter interpreter = Interpreter.createInstance();
interpreter.eval("(load \"foo.abcl\")");
interpreter.eval("(bar)");
}
catch (Throwable t)
{
t.printStackTrace();
}

you can as well catch ConditionThrowable, so you'll be able to retrieve Lisp
Condition.

also, i'd recomend to actually call functions directly rather than using
eval, unless you really want to use eval. you can find some info in mailing
list archives.


.



Relevant Pages