Mercurial > hg > octave-terminal
changeset 7588:cbedf652a752
doc fix for varargin and varargout change
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Mar 2008 13:19:40 -0400 |
parents | 1f662945c2be |
children | 90fb25a5a3fa |
files | doc/interpreter/func.txi |
diffstat | 1 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -362,8 +362,9 @@ arguments should be considered. The problem with this approach is that it can only handle a limited number of input arguments. -Octave supports the @code{varargin} keyword for handling a variable -number of input arguments. Using @code{varargin} the function +If the special parameter name @code{varargin} appears at the end of a +function parameter list it indicates that the function takes a variable +number of input arguments. Using @code{varargin} the function looks like this @example @@ -421,10 +422,10 @@ @cindex variable-length return lists It is possible to return a variable number of output arguments from a function using a syntax that's similar to the one used with the -@code{varargin} keyword. To let a function return a variable number of -output arguments the @code{varargout} keyword is used. As with -@code{varargin} @code{varargout} is a cell array that will contain the -requested output arguments. +special @code{varargin} parameter name. To let a function return a +variable number of output arguments the special output parameter name +@code{varargout} is used. As with @code{varargin}, @code{varargout} is +a cell array that will contain the requested output arguments. As an example the following function sets the first output argument to 1, the second to 2, and so on. @@ -449,6 +450,10 @@ @end group @end example +If @code{varargin} (@code{varargout}) does not appear as the last +element of the input (output) parameter list, then it is not special, +and is handled the same as any other parameter name. + @DOCSTRING(deal) @node Returning From a Function