Ah. I see. It wasn't obvious in either the examples or the source code.
I would like to see more structure: expected arguments, return type, etc.
I would like to see more structure: expected arguments, return type, etc.
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.lispAre all of the standard functions documented this way?
(declaim (ftype (function (number string) number) add-string))
(defun add-string (a b) ...)If you mean structure within the docstrings, there's no official standard, but markup languages for that exist, see Codex[2].
[0]: http://clhs.lisp.se/Body/f_fn_lam.htm
https://github.com/bbatsov/emacs-lisp-style-guide#docstrings
Edited to add: Documentation strings actually predate Common Lisp. They were available at least as early as Zetalisp (mid-1970s).