Skip to content

Instantly share code, notes, and snippets.

@bhyde
Last active December 18, 2015 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bhyde/5754124 to your computer and use it in GitHub Desktop.
Save bhyde/5754124 to your computer and use it in GitHub Desktop.
(in-package #:cl-user)
(defun display-doc-of-package-exports (package)
"Simple code to display the documenation for a package's exports."
(flet ((arglist (sym)
#+ccl (ccl:arglist sym)
#-ccl ()))
(let ((*package* (find-package package)))
(do-external-symbols (s *package*)
(loop
for doc-type in '(function variable
compiler-macro setf method-combination
type structure)
as doc = (documentation s doc-type)
when doc do
(format t "~2&== ~@(~A~): ~A~@[ ~A~]~&~A"
(if (eq 'function doc-type)
(cond
((macro-function s) 'macro)
((special-operator-p s) 'special)
(t doc-type))
doc-type)
s
(case doc-type
((method-combination function compiler-macro)
(arglist s)))
doc))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment