Juan Jose Garcia-Ripoll <[email protected]> writes:
> On Fri, Aug 20, 2010 at 10:23 PM, Pascal J. Bourguignon > <[email protected]> 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! > > (define-condition ext:unix-signal-received () > ((code :type fixnum > :initform 0 > :initarg :signal-code > :accessor ext:unix-signal-received-code)) > (:report (lambda (condition stream) > (format stream "Serious signal ~D caught." > (ext:unix-signal-received-code condition))))) > > Juanjo Sorry, I proposed :initarg :signal-code but you use :code, [...@kuiper :0.0 |MDI| tools]$ ecl ECL (Embeddable Common-Lisp) 10.7.1 Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process SI:TOP-LEVEL 0000000000643f60>. > (apropos "CATCH-SIG") SI:CATCH-SIGNAL Function > (SI:CATCH-SIGNAL 13 t) T > (SI:GETPID) 2348 > Unknown initialization option :CODE for class #<The STANDARD-CLASS SI:UNIX-SIGNAL-RECEIVED> Available restarts: 1. (RESTART-TOPLEVEL) Go back to Top-Level REPL. Broken at SI:BYTECODES. [Evaluation of: (SI:TOP-LEVEL)] In: #<process SI:TOP-LEVEL 0000000000643f60>. >> so you will have to update the definition of the condition: (define-condition ext:unix-signal-received (error) ((code :type fixnum :initform 0 :initarg :code :accessor ext:unix-signal-received-code)) (:report (lambda (condition stream) (format stream "Serious signal ~D caught." (ext:unix-signal-received-code condition))))) -- __Pascal Bourguignon__ http://www.informatimago.com/ ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Ecls-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ecls-list
