docstrings for accessor methods default to docstring of slot from specialized class affects cl:describe cl:documentation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
CL:DESCRIBE return value around accessor methods specialized on a class pick up
the slots docstring (if present) -- why would the documentation for the class'
slot neccesarily be relevant to the accessor method?
SBCL 1.0.47.1 to 1.0.51.x
(defgeneric tt--foo (object)
(:documentation "generic docstring"))
;=> #<STANDARD-
(defgeneric (setf tt--foo) (value object)
(:documentation "setf generic docstring"))
;=> #<STANDARD-
(defclass tt--foo-class ()
((tt--foo
:accessor tt--foo
:documentation "slot docstring" )))
;=> #<STANDARD-CLASS TT--FOO-CLASS>
(describe 'tt--foo)
=> | COMMON-
| [symbol]
|
| TT--FOO names a generic function:
| Lambda-list: (OBJECT)
| Derived type: (FUNCTION (T) *)
| Documentation:
| generic docstring
| Method-combination: STANDARD
| Methods:
| (TT--FOO (TT--FOO-CLASS))
| Documentation:
| slot docstring
| Source file: SYS:SRC;
|
| (SETF TT--FOO) names a generic function:
| Lambda-list: (VALUE OBJECT)
| Derived type: (FUNCTION (T T) *)
| Documentation:
| setf generic docstring
| Method-combination: STANDARD
| Methods:
| ((SETF TT--FOO) (T TT--FOO-CLASS))
| Documentation:
| slot docstring
| Source file: SYS:SRC;
I would expect the docstrings for specialized methods to be null unless
specifically provided.
(documentation (find-method #'tt--foo nil '(tt--foo-class)) t)
;=> "slot docstring"
(documentation (find-method (function (setf tt--foo)) nil '(t tt--foo-class)) t)
;=> "slot docstring"
(setf (documentation (find-method (function (setf tt--foo)) nil '(t tt--foo-class)) t)
"docstring for (setf #'tt--foo) - not slot docstring for the class tt--foo")
;=> "docstring for (setf #'tt--foo) - not slot docstring for the class tt--foo"
(setf (documentation (find-method #'tt--foo nil '(tt--foo-class)) t)
"docstring for method #'tt--foo - not slot docstring for the class tt--foo")
;=> "docstring for method #'tt--foo - not slot docstring for the class tt--foo"
(documentation (find-method #'tt--foo nil '(tt--foo-class)) t)
;=> "docstring for method #'tt--foo - not slot docstring for the class tt--foo"
(documentation (find-method (function (setf tt--foo)) nil '(t tt--foo-class)) t)
;=> "docstring for (setf #'tt--foo) - not slot docstring for the class tt--foo"
(documentation #'tt--foo 'function)
;=> "generic docstring"
(describe 'tt--foo)
=> | COMMON-
| [symbol]
|
| TT--FOO names a generic function:
| Lambda-list: (OBJECT)
| Derived type: (FUNCTION (T) *)
| Documentation:
| generic docstring
| Method-combination: STANDARD
| Methods:
| (TT--FOO (TT--FOO-CLASS))
| Documentation:
| docstring for method #'tt--foo - not slot docstring for the class tt--foo
| Source file: SYS:SRC;
|
| (SETF TT--FOO) names a generic function:
| Lambda-list: (VALUE OBJECT)
| Derived type: (FUNCTION (T T) *)
| Documentation:
| setf generic docstring
| Method-combination: STANDARD
| Methods:
| ((SETF TT--FOO) (T TT--FOO-CLASS))
| Documentation:
| docstring for (setf #'tt--foo) - not slot docstring for the class tt--foo
| Source file: SYS:SRC;