Juan Jose Garcia-Ripoll <juanjose.garciarip...@googlemail.com> writes:

> On Fri, Aug 20, 2010 at 10:23 PM, Pascal J. Bourguignon 
> <p...@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/


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to