X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fdocumentation.lisp;h=89e3404cd981a43eae534a47d2804d4d192de872;hb=d19b5d61e75a24cb5ee6b53630d9ec01106bd641;hp=5735e9ec5ae637672b74c42a3d24766d767b4670;hpb=dbc86b4e5da669dc336c1203f48445393f6ac864;p=jscl.git diff --git a/src/documentation.lisp b/src/documentation.lisp index 5735e9e..89e3404 100644 --- a/src/documentation.lisp +++ b/src/documentation.lisp @@ -1,5 +1,18 @@ ;;; documentation.lisp --- Accessing DOCUMENTATION +;;; Documentation. +(defun documentation (x type) + "Return the documentation of X. TYPE must be the symbol VARIABLE or FUNCTION." + (ecase type + (function + (let ((func (fdefinition x))) + (oget func "docstring"))) + (variable + (unless (symbolp x) + (error "The type of documentation `~S' is not a symbol." type)) + (oget x "vardoc")))) + + ;;; APROPOS and friends (defun map-apropos-symbols (function string package external-only)