(DOCUMENTATION 'F 'FUNCTION) did not work with generic functions

This commit is contained in:
jjgarcia 2005-04-21 09:32:41 +00:00
parent 4f50ddd47e
commit 81a076ee92
2 changed files with 31 additions and 11 deletions

View file

@ -42,6 +42,8 @@ ECL 0.9f
- Pipes are now opened in character mode (M. Pasternacki)
- (DOCUMENTATION 'F 'FUNCTION) did not work with generic functions.
* Foreign function interface (FFI):
- ext:c-uint-max and ext:c-ulong-max did not have the right bignum value.

View file

@ -431,20 +431,38 @@ q (or Q): quits the inspection.~%~
(defmethod documentation ((object symbol) doc-type)
(when (member doc-type +valid-documentation-types+)
(or (when (eq doc-type 'type)
(let ((c (find-class object nil)))
(and c (documentation c t))))
(si::get-documentation object doc-type))))
(case doc-type
(type
(let ((c (find-class object nil)))
(if c
(documentation c t)
(si::get-documentation object doc-type))))
(function
(if (fboundp object)
(documentation (fdefinition object) doc-type)
(si::get-documentation object doc-type)))
(otherwise
(si::get-documentation object doc-type)))))
(defmethod (setf documentation) (new-value (object symbol) doc-type)
(when (member doc-type +valid-documentation-types+)
(or (when (eq doc-type 'type)
(let ((c (find-class object nil)))
(when c
(si::set-documentation object 'type nil)
(si::set-documentation object 'structure nil)
(setf (documentation c t) new-value))))
(si::get-documentation object doc-type)))
(case doc-type
(type
(let ((c (find-class object nil)))
(if c
(progn
(si::set-documentation object 'type nil)
(si::set-documentation object 'structure nil)
(setf (documentation c t) new-value))
(si::set-documentation object doc-type new-value))))
(function
(if (fboundp object)
(let ((c (fdefinition object)))
(si::set-documentation object 'function nil)
(setf (documentation object 'function) new-value))
(si::set-documentation object doc-type new-value)))
(otherwise
(si::set-documentation object doc-type new-value))))
new-value)
(defmethod documentation ((object package) doc-type)