Skip to content
Snippets Groups Projects
Commit b55eff8f authored by gerd's avatar gerd
Browse files

* src/code/error.lisp (condition-slot): Add documentation slot.

	(define-condition): Parse :documentation.
parent 2048dc3a
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.73 2003/04/29 16:27:18 emarsden Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.74 2003/04/30 07:10:09 gerd Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -412,7 +412,10 @@ ...@@ -412,7 +412,10 @@
(allocation nil :type (member :instance :class nil)) (allocation nil :type (member :instance :class nil))
;; ;;
;; If :class allocation, a cons whose car holds the value. ;; If :class allocation, a cons whose car holds the value.
(cell nil :type (or cons null))) (cell nil :type (or cons null))
;;
;; Slot documentation.
(documentation nil :type (or null string)))
(eval-when (compile load eval) (eval-when (compile load eval)
(setf (condition-class-cpl (kernel::find-class 'condition)) (setf (condition-class-cpl (kernel::find-class 'condition))
...@@ -735,7 +738,7 @@ ...@@ -735,7 +738,7 @@
(slot-name {slot-option value}*) (slot-name {slot-option value}*)
where slot-option is one of :READER, :WRITER, :ACCESSOR, :ALLOCATION, where slot-option is one of :READER, :WRITER, :ACCESSOR, :ALLOCATION,
:INITARG, :INITFORM, and :TYPE. :INITARG, :INITFORM, :DOCUMENTATION, and :TYPE.
Each overall option is of the form Each overall option is of the form
...@@ -768,6 +771,7 @@ ...@@ -768,6 +771,7 @@
(let* ((spec (if (consp spec) spec (list spec))) (let* ((spec (if (consp spec) spec (list spec)))
(slot-name (first spec)) (slot-name (first spec))
(allocation :instance) (allocation :instance)
(documentation nil)
(initform-p nil) (initform-p nil)
initform) initform)
(collect ((initargs) (collect ((initargs)
...@@ -794,6 +798,14 @@ ...@@ -794,6 +798,14 @@
(:initarg (initargs arg)) (:initarg (initargs arg))
(:allocation (:allocation
(setq allocation arg)) (setq allocation arg))
(:documentation
(when documentation
(simple-program-error
"More than one slot :DOCUMENTATION in~% ~s" spec))
(unless (stringp arg)
(simple-program-error
"Slot :DOCUMENTATION is not a string in~% ~s" spec))
(setq documentation arg))
(:type) (:type)
(t (t
(simple-program-error "Unknown slot option:~% ~S" (simple-program-error "Unknown slot option:~% ~S"
...@@ -808,6 +820,7 @@ ...@@ -808,6 +820,7 @@
:readers ',(readers) :readers ',(readers)
:writers ',(writers) :writers ',(writers)
:initform-p ',initform-p :initform-p ',initform-p
:documentation ',documentation
:initform :initform
,(if (constantp initform) ,(if (constantp initform)
`',(eval initform) `',(eval initform)
......
...@@ -52,12 +52,15 @@ New in this release: ...@@ -52,12 +52,15 @@ New in this release:
- Accessing arrays in compiled code with out-of-bounds indices - Accessing arrays in compiled code with out-of-bounds indices
now signals a TYPE-ERROR. now signals a TYPE-ERROR.
- DECLARE no longer being a special operator. - DECLARE no longer being a special operator.
- DEFINE-CONDITION accepts slot option :DOCUMENTATION.
* Numerous bugfixes: * Numerous bugfixes:
- NSET-EXCLUSIVE-OR returns the same results as SET-EXCLUSIVE-OR - NSET-EXCLUSIVE-OR returns the same results as SET-EXCLUSIVE-OR
wrt to duplicate elements. wrt to duplicate elements.
- Forms like (MULTIPLE-VALUE-BIND 'LIST) no longer trapping - Forms like (MULTIPLE-VALUE-BIND 'LIST) no longer trapping
an internal compiler error when compiled. an internal compiler error when compiled.
- PARSE-INTEGER signaling PARSE-ERROR.
- Compiler eliminating some type checks in safe code.
* Other changes: * Other changes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment