From: Erik Huelsmann <ehuels@gm...> - 2008-08-04 12:48:07
On 8/4/08, Ville Voutilainen <ville.voutilainen@...> wrote:
> > If you're not afraid to code to the internals of ABCL (they're not
> > that fast moving), I have a function called "safeFuncall" which
> > catches any uncaught conditions and raises them as Java exceptions of
> > type "ConditionThrowable".
> Sounds interesting. Is this code in ABCL cvs or just something
> external you implemented?
> > Exactly. Want to have the code? Or maybe I should suggest adding this
> > code to the LispObject implementation?
> Yes, if you can post the code I'd be interested in looking at it and probably
> using it, too. The idea of adding it to LispObject sounds good too, since
> some people use LispObject for invoking lisp code. I am personally more
> inclined to use Interpreter, since I deal with code that has quite a bit
> of macros. Anyway, having LispObject throw java-exceptions on uncaught
> conditions is IMHO very useful. I wouldn't modify Interpreter to do the
> same, though.
It's not possible to change the behaviour of the interpreter, but you
could wrap the interpreter's eval() to be safeEval() with the same
trick that I did with safeFuncall().
I have an extreme amount of function calls into lisp to achieve what I
need to do, but I don't work with macro's a lot, however, doing it my
way doesn't mean "no macros", it simply means you can't call code
which is defined by a macro (ie I call DEFUNs).
I'll post the code I have this evening (CET).