Jump to content

Documentation: Difference between revisions

new Emacs Lisp
(added swift)
(new Emacs Lisp)
Line 378:
 
This view was produced by [[EiffelStudio]] which also supports an '''Interface''' view which is similar to the Contract view above, but also includes contracts for any inherited routines, and the complete inherited class invariant. EiffelStudio can publish these and other documentation view in HTML and other formats suitable for sharing.
 
=={{header|Emacs Lisp}}==
In <code>defun</code>, <code>defmacro</code> and <code>defsubst</code> an optional docstring can follow the formal parameters.
 
<lang Lisp>(defun hello (n)
"Say hello to the user."
(message "hello %d" n))</lang>
 
For <code>defvar</code>, <code>defconst</code> or <code>defcustom</code> an optional docstring follows the value.
 
<lang Lisp>(defvar one-hundred 100
"The number one hundred.")</lang>
 
Most other defining forms have similar optional docstrings. In all cases they must be a string constant.
 
Docstrings have no effect on code execution but are available to the user or programmer in <code>C-h f</code> (<code>describe-function</code>) etc. The docstring of a major mode function is its <code>C-h m</code> help (<code>describe-mode</code>). The Emacs Lisp Reference Manual "Tips for Documentation Strings" describes various stylistic conventions.
 
The byte compiler (of Emacs 19.29 up) generates "dynamic docstrings" in the <code>.elc</code> files which means docstrings are not loaded into memory until actually viewed.
 
=={{header|Erlang}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.