[Next] [Previous] [Up] [Top] [Contents] [Index]

Documentation commands

Documentation

Many built-in definitions have associated documentation. In addition, your own definitions can include documentation strings. These documentation strings will be returned when the definition is compiled only if the value of the global variable *save-doc-strings* is true. The default value of this variable is false.

The following function definition includes a documentation string. The exact placement of the documentation string varies among different types of definitions. Check the Common Lisp specification for details.

 (defun fact (number)
  "Returns the factorial of a number."
    (if (= 0 number)
      1
      (* number (fact (- number 1)))))
There are three ways to retrieve the documentation of a definition:

  • Through the function documentation, which takes a symbol as its first argument and a documentation type as its second argument. It returns the documentation string of that type for the symbol if one exists. The second argument should be function or type. See the Common Lisp documentation for details.
  • By using the Fred command Control-x Control-d, when the cursor is in a symbol or when a symbol is selected. This will cause the documentation associated with the symbol to be displayed in a documentation window.
  • Through the Get Info window or the Inspector, available through the Tools menu.


  • Gettmg Started with MCL - 19 OCT 1996
    [Next] [Previous] [Up] [Top] [Contents] [Index]

    Generated with Harlequin WebMaker