(variable
(typecase x
(symbol (values (info :variable :documentation x)))))
+ ;; FUNCTION is not used at the momemnt, just here for symmetry.
(function
(cond ((functionp x)
(%fun-doc x))
- ((legal-fun-name-p x)
- (values (info :function :documentation x)))))
+ ((and (legal-fun-name-p x) (fboundp x))
+ (%fun-doc (or (and (symbolp x) (macro-function x))
+ (fdefinition x))))))
(structure
(typecase x
(symbol (cond
(case doc-type
(variable (setf (info :variable :documentation name) string))
(function
- (when (legal-fun-name-p name)
- (setf (info :function :documentation name) string)))
+ ;; KLUDGE: FDEFINITION isn't ready early enough during cold-init, so
+ ;; special case for symbols.
+ (if (symbolp name)
+ (setf (%fun-doc (symbol-function name)) string)
+ (when (legal-fun-name-p name)
+ (setf (%fun-doc (fdefinition name)) string))))
(structure (cond
((eq (info :type :kind name) :instance)
(setf (info :type :documentation name) string))