X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-misc.lisp;h=1352638217d69457b235fc59fc5403ea350c44cc;hb=95591ed483dbb8c0846c129953acac1554f28809;hp=1440394ce4ded7c727bd23d90ed442edd8734dd0;hpb=df871446529da0e83d670f35a9566c11d814be32;p=sbcl.git diff --git a/src/code/target-misc.lisp b/src/code/target-misc.lisp index 1440394..1352638 100644 --- a/src/code/target-misc.lisp +++ b/src/code/target-misc.lisp @@ -113,15 +113,23 @@ (setf (%simple-fun-name (%fun-fun function)) new-value))) new-value) -(defun %fun-doc (x) - ;; FIXME: This business of going through %FUN-NAME and then globaldb - ;; is the way CMU CL did it, but it doesn't really seem right. - ;; When/if weak hash tables become supported again, using a weak - ;; hash table to maintain the object/documentation association would - ;; probably be better. - (let ((name (%fun-name x))) - (when (and name (typep name '(or symbol cons))) - (values (info :function :documentation name))))) +(defun %fun-doc (function) + (typecase function + #!+sb-eval + (sb!eval:interpreted-function + (sb!eval:interpreted-function-documentation function)) + (t + (%simple-fun-doc (%fun-fun function))))) + +(defun (setf %fun-doc) (new-value function) + (declare (type (or null string) new-value)) + (typecase function + #!+sb-eval + (sb!eval:interpreted-function + (setf (sb!eval:interpreted-function-documentation function) new-value)) + ((or simple-fun closure) + (setf (%simple-fun-doc (%fun-fun function)) new-value))) + new-value) ;;; various environment inquiries