From d46a345be37cd1be821efd75c9df1493660efd9f Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Sat, 30 Aug 1997 18:40:27 +0000 Subject: [PATCH] Re-define the documentation function according to the ANSI CL spec.; the doc-type argument is no longer optional. --- pcl/generic-functions.lisp | 22 ++++++++++++---------- pcl/std-class.lisp | 13 ++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/pcl/generic-functions.lisp b/pcl/generic-functions.lisp index 00d71d767..23faf75cf 100644 --- a/pcl/generic-functions.lisp +++ b/pcl/generic-functions.lisp @@ -622,6 +622,18 @@ ; (slot-class forward-referenced-class) ; (funcallable-standard-class standard-class) +(defgeneric (setf documentation) (new-value slotd doc-type) + (:argument-precedence-order doc-type slotd new-value)) +; (t t) +; (t documentation-mixin) +; (t standard-slot-definition) + +(defgeneric documentation (slotd doc-type) + (:argument-precedence-order doc-type slotd)) +; (t) +; (documentation-mixin) +; (standard-slot-definition) + ;;; 3 arguments (defgeneric add-boundp-method (class generic-function slot-name)) @@ -693,16 +705,6 @@ ;;; optional arguments -(defgeneric (setf documentation) (new-value slotd &optional doc-type)) -; (t t) -; (t documentation-mixin) -; (t standard-slot-definition) - -(defgeneric documentation (slotd &optional doc-type)) -; (t) -; (documentation-mixin) -; (standard-slot-definition) - (defgeneric get-method (generic-function qualifiers specializers &optional (errorp t))) ; (standard-generic-function t t) diff --git a/pcl/std-class.lisp b/pcl/std-class.lisp index f9bf0fec5..4949963e1 100644 --- a/pcl/std-class.lisp +++ b/pcl/std-class.lisp @@ -113,29 +113,28 @@ (when documentation-p (setf (plist-value object 'documentation) documentation))) -(defmethod documentation (object &optional doc-type) +(defmethod documentation (object doc-type) (declare (ignore object doc-type)) nil) -(defmethod (setf documentation) (new-value object &optional doc-type) +(defmethod (setf documentation) (new-value object doc-type) (declare (ignore new-value doc-type)) (error "Can't change the documentation of ~S." object)) - -(defmethod documentation ((object documentation-mixin) &optional doc-type) +(defmethod documentation ((object documentation-mixin) doc-type) (declare (ignore doc-type)) (plist-value object 'documentation)) -(defmethod (setf documentation) (new-value (object documentation-mixin) &optional doc-type) +(defmethod (setf documentation) (new-value (object documentation-mixin) doc-type) (declare (ignore doc-type)) (setf (plist-value object 'documentation) new-value)) -(defmethod documentation ((slotd standard-slot-definition) &optional doc-type) +(defmethod documentation ((slotd standard-slot-definition) doc-type) (declare (ignore doc-type)) (slot-value slotd 'documentation)) -(defmethod (setf documentation) (new-value (slotd standard-slot-definition) &optional doc-type) +(defmethod (setf documentation) (new-value (slotd standard-slot-definition) doc-type) (declare (ignore doc-type)) (setf (slot-value slotd 'documentation) new-value)) -- GitLab