Hi
sorry for the noise, but I need a quick answer from the ABCL
developers. I tried the mailing list, but the responses are not
coming (*).
I would like to embed ABCL in a Java program. My question is about
conditions and exceptions. I understand that I can evaluate a CL
expression calling the appropriate Java method, but I have not figured
out how a call to ERROR would be handled. Better: it seems to me that
I have no way to get a Java exception (optimal situation) or an error
code in the embedding Java out of such call.
Any help would be appreciated.
Thanks
--
Marco Antoniotti
On Oct 30, 12:11 pm, Marco Antoniotti <·······@gmail.com> wrote:
> Hi
>
> sorry for the noise, but I need a quick answer from the ABCL
> developers. I tried the mailing list, but the responses are not
> coming (*).
>
> I would like to embed ABCL in a Java program. My question is about
> conditions and exceptions. I understand that I can evaluate a CL
> expression calling the appropriate Java method, but I have not figured
> out how a call to ERROR would be handled. Better: it seems to me that
> I have no way to get a Java exception (optimal situation) or an error
> code in the embedding Java out of such call.
>
> Any help would be appreciated.
>
> Thanks
>
> --
> Marco Antoniotti
(*) I understand that people have a lot to do these days. It's me
who is in a bit of a hurry. No criticism was intended for the ABCL
people.
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.