Mercurial > hg > octave-lyh
changeset 12593:47417d37c4db stable
Trivial merge of two stable heads
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Tue, 12 Apr 2011 01:28:31 -0500 |
parents | 732a568bf694 (diff) 4727fd4dd4bb (current diff) |
children | 68eb9713b550 |
files | |
diffstat | 2 files changed, 25 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 Rik <octave@nomad.inbox5.com> + + * interpreter/func.txi: Add discussion of isargout to Ignoring + Arguments section of documentation. + 2011-04-07 Rik <octave@nomad.inbox5.com> * interpreter/Makefile.am: Add spellcheck target to documentation
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -342,8 +342,6 @@ @DOCSTRING(nargoutchk) -@DOCSTRING(isargout) - @anchor{doc-varargin} @anchor{doc-varargout} @node Variable-length Argument Lists @section Variable-length Argument Lists @@ -456,6 +454,26 @@ The value of @code{nargin} is not affected by using this declaration. +Return arguments can also be ignored using the same syntax. Functions may +take advantage of ignored outputs to reduce the number of calculations +performed. To do so, use the @code{isargout} function to query whether the +output argument is wanted. For example: + +@example +@group +function [out1, out2] = long_function (x, y, z) + if (isargout (1)) + ## Long calculation + @dots{} + out1 = result; + endif + @dots{} +endfunction +@end group +@end example + +@DOCSTRING(isargout) + @node Variable-length Return Lists @section Variable-length Return Lists @cindex variable-length return lists