From: Andras S. <as...@ma...> - 2005-11-07 00:29:47
|
On Fri, 4 Nov 2005, Peter Graves wrote: > > Something along the lines of (completely untested): > > catch (Throwable t) { > Class tClass = t.getClass(); > Symbol condition = getCondition(t.getClass()); > if (condition == null) > // The cause slot gets initialized by the JavaException > // constructor here, since we're calling it directly. > signal(new JavaException(t)); > else > // But here you have to do it by hand, since we're really > // constructing a STANDARD-OBJECT. > //signal(condition, new SimpleString(getMessage(t))); > Symbol.SIGNAL.execute( > condition, > Keyword.CAUSE, > new JavaObject(t), > Keyword.FORMAT_CONTROL, > new SimpleString(getMessage(t))); > } It's tested now :) > > In the second case, you probably also want to verify that the condition > you're about to signal is a subclass of JAVA-EXCEPTION before you pass > it the :CAUSE initarg, since otherwise it won't have that slot. Perhaps the best place for this check would be in Java.getCondition(). In any case, I could do with some help on how to do this, because I don't even know to get the condition associated with a symbol on the Java side. Andras |