[Ecls-list] Signaling a more specific condition on signals.

Pascal J. Bourguignon pjb at informatimago.com
Mon Aug 30 23:14:04 UTC 2010


Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:

> On Fri, Aug 20, 2010 at 10:23 PM, Pascal J. Bourguignon <pjb at informatimago.com> wrote:
>
>     When a unix signal is received, ecl cl:signals a simple-error with:
>    
>     unixint.d:370:                FEerror("Serious signal ~D caught.", 1, signal_code);
>    
>     In this it would be better if a specific condition was signaled
>     instead, so that applications could more easily handle the signal.
>
> It's in CVS now. Slight change of names. Please report if it works for you!

Sorry but there's still something.  Since most exceptions are
asynchronous, we often want to record them and then go on with the
current code (which has no problem).  Therefore we would need actually
a continuable error here instead of a normal error.

Therefore instead of:

    cl_error(3, @'ext::unix-signal-received', @':code', signal_code);

I think we should use:

    cl_cerror(4,make_constant_base_string("Ignore signal ~:*~D"),
              @'ext::unix-signal-received', @':code', signal_code);

So for example you can write:

CL-USER> (let ((sigpipes 0))
           (handler-bind 
             ((ext::unix-signal-received (lambda (condi)
                                          (incf sigpipes)
                                          (invoke-restart 'continue))))
             (loop with end = (+ (get-universal-time) 20)
                   while (< (get-universal-time) end)
                   do (sleep 1) (princ ".") (finish-output)))
             sigpipes)
........................
12

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/





More information about the ecl-devel mailing list