diff doc/interpreter/func.txi @ 3371:86873384cd10

[project @ 1999-11-21 17:31:07 by jwe]
author jwe
date Sun, 21 Nov 1999 17:31:10 +0000
parents bfe1573bd2ae
children 9610d364e444
line wrap: on
line diff
--- a/doc/interpreter/func.txi	Sun Nov 21 16:34:51 1999 +0000
+++ b/doc/interpreter/func.txi	Sun Nov 21 17:31:10 1999 +0000
@@ -227,30 +227,9 @@
 were passed to Octave.
 @end defvr
 
-@defvr {Built-in Variable} silent_functions
-If the value of @code{silent_functions} is nonzero, internal output
-from a function is suppressed.  Otherwise, the results of expressions
-within a function body that are not terminated with a semicolon will
-have their values printed.  The default value is 0.
-
-For example, if the function
+@DOCSTRING(silent_functions)
 
-@example
-function f ()
-  2 + 2
-endfunction
-@end example
-
-@noindent
-is executed, Octave will either print @samp{ans = 4} or nothing
-depending on the value of @code{silent_functions}.
-@end defvr
-
-@defvr {Built-in Variable} warn_missing_semicolon
-If the value of this variable is nonzero, Octave will warn when
-statements in function definitions don't end in semicolons.  The default
-value is 0.
-@end defvr
+@DOCSTRING(warn_missing_semicolon)
 
 @node Multiple Return Values, Variable-length Argument Lists, Defining Functions, Functions and Scripts
 @section Multiple Return Values
@@ -366,27 +345,11 @@
 At the top level, @code{nargout} is undefined.
 @end defvr
 
-@defvr {Built-in Variable} default_return_value
-The value given to otherwise uninitialized return values if
-@code{define_all_return_values} is nonzero.  The default value is
-@code{[]}.
-@end defvr
+@DOCSTRING(default_return_value)
 
-@defvr {Built-in Variable} define_all_return_values
-If the value of @code{define_all_return_values} is nonzero, Octave
-will substitute the value specified by @code{default_return_value} for
-any return values that remain undefined when a function returns.  The
-default value is 0.
-@end defvr
+@DOCSTRING(define_all_return_values)
 
-@deftypefn {Function File} {} nargchk (@var{nargin_min}, @var{nargin_max}, @var{n})
-If @var{n} is in the range @var{nargin_min} through @var{nargin_max}
-inclusive, return the empty matrix.  Otherwise, return a message
-indicating whether @var{n} is too large or too small.
-
-This is useful for checking to see that the number of arguments supplied
-to a function is within an acceptable range.
-@end deftypefn
+@DOCSTRING(nargchk)
 
 @node Variable-length Argument Lists, Variable-length Return Lists, Multiple Return Values, Functions and Scripts
 @section Variable-length Argument Lists
@@ -418,20 +381,9 @@
 The ellipsis that marks the variable argument list may only appear once
 and must be the last element in the list of arguments.
 
-@deftypefn {Built-in Function} {} va_start ()
-Position an internal pointer to the first unnamed argument and allows
-you to cycle through the arguments more than once.  It is not necessary
-to call @code{va_start} if you do not plan to cycle through the
-arguments more than once.  This function may only be called inside
-functions that have been declared to accept a variable number of input
-arguments.
-@end deftypefn
+@DOCSTRING(va_arg)
 
-@deftypefn {Built-in Function} {} va_arg ()
-Return the value of the next available argument and move the internal
-pointer to the next argument.  It is an error to call @code{va_arg()}
-when there are no more arguments available.
-@end deftypefn
+@DOCSTRING(va_start)
 
 Sometimes it is useful to be able to pass all unnamed arguments to
 another function.  The keyword @var{all_va_args} makes this very easy to
@@ -497,15 +449,7 @@
 return list may only appear once and must be the last element in the
 list of returned values.
 
-@deftypefn {Built-in Function} {} vr_val (@var{val})
-Each time this function is called, it places the value of its argument
-at the end of the list of values to return from the current function.
-Once @code{vr_val} has been called, there is no way to go back to the
-beginning of the list and rewrite any of the return values.  This
-function may only be called within functions that have been declared to
-return an unspecified number of output arguments (by using the special
-ellipsis notation described above).
-@end deftypefn
+@DOCSTRING(vr_val)
 
 @node Returning From a Function, Function Files, Variable-length Return Lists, Functions and Scripts
 @section Returning From a Function
@@ -555,25 +499,7 @@
 at the end of every function definition.
 @end defvr
 
-@defvr {Built-in Variable} return_last_computed_value
-If the value of @code{return_last_computed_value} is true, and a
-function is defined without explicitly specifying a return value, the
-function will return the value of the last expression.  Otherwise, no
-value will be returned.  The default value is 0.
-
-For example, the function
-
-@example
-function f ()
-  2 + 2;
-endfunction
-@end example
-
-@noindent
-will either return nothing, if the value of
-@code{return_last_computed_value} is 0, or 4, if the value of
-@code{return_last_computed_value} is nonzero.
-@end defvr
+@DOCSTRING(return_last_computed_value)
 
 @node Function Files, Script Files, Returning From a Function, Functions and Scripts
 @section Function Files
@@ -630,62 +556,13 @@
 
 @c XXX FIXME XXX -- note about time stamps on files in NFS environments?
 
-@defvr {Built-in Variable} DEFAULT_LOADPATH
-A colon separated list of directories in which to search for function
-files by default.  The value of this variable is also automatically
-substituted for leading, trailing, or doubled colons that appear in the
-built-in variable @code{LOADPATH}.
-@end defvr
-
-@defvr {Built-in Variable} LOADPATH
-A colon separated list of directories in which to search for function
-files.  @xref{Functions and Scripts}.  The value of @code{LOADPATH}
-overrides the environment variable @code{OCTAVE_PATH}.  @xref{Installation}.
+@DOCSTRING(DEFAULT_LOADPATH)
 
-@code{LOADPATH} is now handled in the same way as @TeX{} handles
-@code{TEXINPUTS}.  Leading, trailing, or doubled colons that appear in
-@code{LOADPATH} are replaced by the value of @code{DEFAULT_LOADPATH}.
-The default value of @code{LOADPATH} is @code{":"}, which tells Octave
-to search in the directories specified by @code{DEFAULT_LOADPATH}.
-
-In addition, if any path element ends in @samp{//}, that directory and
-all subdirectories it contains are searched recursively for function
-files.  This can result in a slight delay as Octave caches the lists of
-files found in the @code{LOADPATH} the first time Octave searches for a
-function.  After that, searching is usually much faster because Octave
-normally only needs to search its internal cache for files.
+@DOCSTRING(LOADPATH)
 
-To improve performance of recursive directory searching, it is best for
-each directory that is to be searched recursively to contain
-@emph{either} additional subdirectories @emph{or} function files, but
-not a mixture of both.
-
-@xref{Organization of Functions} for a description of the function file
-directories that are distributed with Octave.
-@end defvr
+@DOCSTRING(ignore_function_time_stamp)
 
-@defvr {Built-in Variable} ignore_function_time_stamp
-This variable can be used to prevent Octave from making the system call
-@code{stat} each time it looks up functions defined in function files.
-If @code{ignore_function_time_stamp} to @code{"system"}, Octave will not
-automatically recompile function files in subdirectories of
-@file{@var{octave-home}/lib/@var{version}} if they have changed since
-they were last compiled, but will recompile other function files in the
-@code{LOADPATH} if they change.  If set to @code{"all"}, Octave will not
-recompile any function files unless their definitions are removed with
-@code{clear}.  For any other value of @code{ignore_function_time_stamp},
-Octave will always check to see if functions defined in function files
-need to recompiled.  The default value of @code{ignore_function_time_stamp} is
-@code{"system"}.
-@end defvr
-
-@defvr {Built-in Variable} warn_function_name_clash
-If the value of @code{warn_function_name_clash} is nonzero, a warning is
-issued when Octave finds that the name of a function defined in a
-function file differs from the name of the file.  (If the names
-disagree, the name declared inside the file is ignored.)  If the value
-is 0, the warning is omitted.  The default value is 1.
-@end defvr
+@DOCSTRING(warn_function_name_clash)
 
 @node Script Files, Dynamically Linked Functions, Function Files, Functions and Scripts
 @section Script Files
@@ -788,11 +665,7 @@
 the name @file{@var{file}.m}, you can use the function @code{source} to
 execute commands from any file.
 
-@deftypefn {Built-in Function} {} source (@var{file})
-Parse and execute the contents of @var{file}.  This is equivalent to
-executing commands from a script file, but without requiring the file to
-be named @file{@var{file}.m}.
-@end deftypefn
+@DOCSTRING(source)
 
 @node Dynamically Linked Functions, Organization of Functions, Script Files, Functions and Scripts
 @section Dynamically Linked Functions
@@ -969,18 +842,15 @@
 control how Octave behaves when dynamically linked functions are cleared
 or reloaded.
 
+@c XXX FIXME XXX -- this variable no longer exists!
+
 @defvr {Built-in Variable} auto_unload_dot_oct_files
 If the value of @code{auto_unload_dot_oct_files} is nonzero, Octave will
 automatically unload any @file{.oct} files when there are no longer any
 functions in the symbol table that reference them.
 @end defvr
 
-@defvr {Built-in Variable} warn_reload_forces_clear
-If several functions have been loaded from the same file, Octave must
-clear all the functions before any one of them can be reloaded.  If
-@code{warn_reload_forces_clear}, Octave will warn you when this happens,
-and print a list of the additional functions that it is forced to clear.
-@end defvr
+@DOCSTRING(warn_reload_forces_clear)
 
 Additional examples for writing dynamically linked functions are
 available in the files in the @file{src} directory of the Octave