[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with the condition system
Date: Mon, 2 Sep 91 11:27+0100
From: Vincent Keunen <firstname.lastname@example.org>
Subject: Problem with the condition system
Character-Type-Mappings: (1 0 (NIL 0) (NIL :ROMAN NIL) "CPTFONT")
Fonts: CPTFONT, CPTFONT
I am building a pathname from various elements, some of which are
sometimes NIL. In these cases, the pathname looks like
"m:>nrbr01>NIL>ethernet>..." which I would like to avoid. Therefore I
figured I could use the new condition system (I know it's not a stable
standard yet, but I'd like to see how it works).
I planned on testing each element for its "NIL-ity" and delare an error
when it is NIL (with cerror). Therefore I need to create a new condition
(eventually inheriting from file-error). Here is what I use (very close
to the example of page 900 of cltl2 - I'm glad I don't have to
*pronouce* that!) to define the condition "1pathname-component-is-nil-error0":1
(future-common-lisp:define-condition pathname-component-is-nil-error ()
(cisco-name interface-name interface-number)
(lambda (condition stream)
(clos::with-slots (cisco-name interface-name interface-number)
"A pathname cannot be constructed because some of its components are null.~@
The components are :~& Cisco name : ~a~& Interface name : ~a~& Interface number : ~a"
cisco-name interface-name interface-number)))))
0Then to test it, I create the error:
"Skip creating the file and loose these statistics."
0... but I'm thrown in the debugger :
Error: Flavor PATHNAME-COMPONENT-IS-NIL-ERROR does not handle the init keywords :CISCO-NAME, :I
While in the function MAKE-INSTANCE MAKE-CONDITION FUTURE-COMMON-LISP:MAKE-CONDITION
Arg 0 (SYS:FLAVOR-NAME): PATHNAME-COMPONENT-IS-NIL-ERROR
Rest arg (FLAVOR::INIT-OPTIONS): (:CISCO-NAME "nrbr01" :INTERFACE-NAME "Ethernet" ...)
s-A, : Ignore the unhandled init keywords.
s-B, : Return to Breakpoint ZMACS in Editor Typeout Window 1
s-C: Editor Top Level
s-D: Restart process Zmacs Windows
So my questions are:
1- Does the condition system implemented by Symbolics follow cltl2
(namely is it based on clos or still on flavors as this error message
2- Or is there a point I missed?
3- I must admit I don't really understand well the various aspects of
the condition system and how they relate together (signal, error,
Has anybody any useful insights?