1 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package "SB!KERNEL")
12 (!defstruct-with-alternate-metaclass condition
13 :slot-names
(assigned-slots hash
)
14 ;; constructor is never called, but (FIXME) the macro syntax requires it
15 :boa-constructor %make-condition-object
17 :metaclass-name condition-classoid
18 :metaclass-constructor make-condition-classoid
21 ;;; Define just enough condition-classoids to get TYPEP
22 ;;; to optimize into classoid-typep.
23 (macrolet ((def (name direct-supers
&rest inherits
)
24 `(eval-when (:compile-toplevel
:execute
)
25 ;; INHERITS is a list of symbols, unevaluated,
26 ;; excluding T which is assumed.
27 (%compiler-define-condition
28 ',name
',direct-supers
30 :classoid
(make-undefined-classoid name
)
31 :inherits
(map 'vector
#'find-layout
(cons t inherits
))
35 ;; These are grotesquely OAOO-violating, but on the bright side,
36 ;; compilation will fail if the subsequent real definition differs,
37 ;; so there's a built-in safety net.
38 ;; As has been suggested in 'cross-condition', a DEF!CONDITION macro
39 ;; might help, but still that's possibly not a complete solution,
40 ;; because DEBUG-CONDITION is defined in a file with the :NOT-HOST flag.
41 (def warning
(condition) condition
)
42 (def style-warning
(warning) condition warning
)
43 (def compiler-note
(condition) condition
)
44 (def parse-unknown-type
(condition) condition
)
45 (def parse-deprecated-type
(condition) condition
)
46 (def serious-condition
(condition) condition
)
47 (def error
(serious-condition) condition serious-condition
)
48 (def sb
!di
:debug-condition
(serious-condition) condition serious-condition
)
49 (def stream-error
(error) condition serious-condition error
)
50 (def reference-condition
(condition) condition
)