octave: A Sample Function Description

 
 1.3.5.1 A Sample Function Description
 .....................................
 
 In a function description, the name of the function being described
 appears first.  It is followed on the same line by a list of parameters.
 The names used for the parameters are also used in the body of the
 description.
 
    After all of the calling forms have been enumerated, the next line is
 a concise one-sentence summary of the function.
 
    After the summary there may be documentation on the inputs and
 outputs, examples of function usage, notes about the algorithm used, and
 references to related functions.
 
    Here is a description of an imaginary function ‘foo’:
 
  -- : foo (X)
  -- : foo (X, Y)
  -- : foo (X, Y, ...)
      Subtract X from Y, then add any remaining arguments to the result.
 
      The input X must be a numeric scalar, vector, or array.
 
      The optional input Y defaults to 19 if it is not supplied.
 
      Example:
 
           foo (1, [3, 5], 3, 9)
                ⇒ [ 14, 16 ]
           foo (5)
                ⇒ 14
 
      More generally,
 
           foo (W, X, Y, ...)
           ≡
           X - W + Y + ...
 
      See also: bar
 
    Any parameter whose name contains the name of a type (e.g., INTEGER
 or MATRIX) is expected to be of that type.  Parameters named OBJECT may
 be of any type.  Parameters with other sorts of names (e.g., NEW_FILE)
 are discussed specifically in the description of the function.  In some
 sections, features common to parameters of several functions are
 described at the beginning.