0.8.2.29:
[sbcl.git] / src / code / late-condition.lisp
1 ;;;; Condition support in target lisp
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
11
12 (in-package "SB-KERNEL")
13 \f
14 (fmakunbound 'install-condition-slot-reader)
15 (fmakunbound 'install-condition-slot-writer)
16 (defun install-condition-slot-reader (name condition slot-name)
17   (unless (fboundp name)
18     (ensure-generic-function name))
19   (eval `(defmethod ,name ((.condition. ,condition))
20            (condition-reader-function .condition. ',slot-name))))
21 (defun install-condition-slot-writer (name condition slot-name)
22   (unless (fboundp name)
23     (ensure-generic-function name))
24   (eval `(defmethod ,name (new-value (.condition. ,condition))
25            (condition-writer-function .condition. new-value ',slot-name))))