2
;;;; Author: Paul Dietz
3
;;;; Created: Wed Jul 2 07:05:41 2003
4
;;;; Contains: Macros used in ansi-aux and elsewhere.
8
(declaim (optimize (safety 3)))
10
;;; Macros to avoid annoying sbcl warning notes
12
(defmacro handler-case (form &rest cases)
13
`(let () (cl:handler-case ,form ,@cases)))
15
(defmacro handler-bind (handlers &rest body)
16
`(let () (cl:handler-bind ,handlers (normally (progn ,@body)))))
18
;;; Macros for avoiding dead code warnings
20
(defvar *should-always-be-true* t)
22
(declaim (notinline should-never-be-called))
24
(defun should-never-be-called () nil)
26
(defmacro normally (form &optional (default-form
27
'(should-never-be-called)))
28
`(if *should-always-be-true* ,form ,default-form))
30
;;; Macro to ignore errors, but report them anyway
32
(defparameter *report-and-ignore-errors-break* nil
33
"When true, REPORT-AND-IGNORE-ERRORS breaks instead of discarding the error condition.")
35
(defmacro report-and-ignore-errors (&body body)
36
`(eval-when (:load-toplevel :compile-toplevel :execute)
37
(#+sbcl let #+sbcl () #-sbcl progn
43
(when *report-and-ignore-errors-break* (break))
44
(values nil condition))))))