+;;; an error apparently caused by a bug in SBCL itself
+;;;
+;;; Note that we don't make any serious effort to use this condition
+;;; for *all* errors in SBCL itself. E.g. type errors and array
+;;; indexing errors can occur in functions called from SBCL code, and
+;;; will just end up as ordinary TYPE-ERROR or invalid index error,
+;;; because the signalling code has no good way to know that the
+;;; underlying problem is a bug in SBCL. But in the fairly common case
+;;; that the signalling code does know that it's found a bug in SBCL,
+;;; this condition is appropriate, reusing boilerplate and helping
+;;; users to recognize it as an SBCL bug.
+(define-condition bug (simple-error)
+ ()
+ (:report
+ (lambda (condition stream)
+ (format stream
+ "~@< ~? ~:@_~?~:>"
+ (simple-condition-format-control condition)
+ (simple-condition-format-arguments condition)
+ "~@<This is probably a bug in SBCL itself. (Alternatively, ~
+ SBCL might have been corrupted by bad user code, e.g. by an ~
+ undefined Lisp operation like ~S, or by stray pointers from ~
+ alien code or from unsafe Lisp code; or there might be a bug ~
+ in the OS or hardware that SBCL is running on.) If it seems to ~
+ be a bug in SBCL itself, the maintainers would like to know ~
+ about it. Bug reports are welcome on the SBCL ~
+ mailing lists, which you can find at ~
+ <http://sbcl.sourceforge.net/>.~:@>"
+ '((fmakunbound 'compile))))))
+(defun bug (format-control &rest format-arguments)
+ (error 'bug
+ :format-control format-control
+ :format-arguments format-arguments))
+
+;;; a condition for use in stubs for operations which aren't supported
+;;; on some platforms