2008/3/26, Erik Huelsmann ehuels@gmail.com:
On 3/26/08, Hans Huebner hans.huebner@gmail.com wrote:
Here is an email I received from Tobias in response to my suggestion to wrap the body of invocations of WITH-CONNECTED-SOCKET with a WITH-MAPPED-CONDITIONS. We discussed his comment afterwards and came to the conclusion that it will be problematic to get nested occurences of WITH-CONNECTED-SOCKET to work if the all of the handlers for any of the involved conditions declines. For conditions signalled with ERROR (which is what usocket needs to do anyway) this will be no problem, as ERROR itself will invoke the debugger if all handlers decline. With SIGNAL, the behavior Tobias describes could be observed, which would clearly be unwanted.
Well, Tobias indicates absense of RESIGNAL or DECLINE, but when a handler returns from a SIGNALled condition, in handler-bind, that's considered a DECLINE.
If you want to make an explicit RESIGNAL, you can simply take the 'w' parameter to the handler function and (SIGNAL w) again. Note that that's a new invocation of SIGNAL, which in itself can return. If you decide to handle a returning SIGNAL by returning yourself from the handler function, that's also considered a DECLINE. In the case of SIGNAL, that means the SIGNAL statement will return NIL and continue execution.
Does that not allow you to do what you want to do? I mean... you can get a single printed line in the output below by just returning from your handler (removing the SIGNAL statement).
I'm fine with using ERROR in the signal handler to resignal the converted condition. Tobias could not post to the list himself and after discussing with him off-list, we agreed that I should forward his concerns to the list. I have also added a warning comment to the source code reminding what declining means. Patch to follow.
-Hans