X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Finfo-functions.lisp;h=e67f1a2b083cb3526307c0dd7ca883564d345e58;hb=5745b5a5b2e3b967bf3876b4306f31b3c78495fa;hp=293b123ef559cf12ab9831088f5c5634a35e6107;hpb=c593dc26733b179db6c12c7085ed76b762ac256b;p=sbcl.git diff --git a/src/compiler/info-functions.lisp b/src/compiler/info-functions.lisp index 293b123..e67f1a2 100644 --- a/src/compiler/info-functions.lisp +++ b/src/compiler/info-functions.lisp @@ -226,11 +226,13 @@ return NIL. Can be set with SETF when ENV is NIL." (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 @@ -259,8 +261,12 @@ return NIL. Can be set with SETF when ENV is NIL." (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))