Why would you do that in a doc-string? If you just `declare` the types with `declare` instead of putting them in the docstring, the compiler can also take advantage of them. Then the system can automatically tell you that information back. It will also infer the return type for you automatically.
A trivial example (your editor can do this for you):
(defun add-string (a b)
(declare (number a) (string b))
"Parses b and adds to a"
(+ a (parse-integer b)))
CL-USER> (describe #'add-string)
#<FUNCTION ADD-STRING>
[compiled function]
Lambda-list: (A B)
Derived type: (FUNCTION (NUMBER STRING) (VALUES NUMBER &OPTIONAL))
Documentation:
Parses b and adds to a
Source file: /home/bja/foo.lisp
I think so (at least on sbcl). I don't use common lisp all that much, I mostly knew about describe due to the which-key menus in the emacs SLIME environment.
I have perused the source for Steel Bank Common Lisp, but it's far from clear if everything in the standard is documented this way or if one must keep a tab open to the Common Lisp specification for such references.
A trivial example (your editor can do this for you):