Mercurial > hg > octave-nkf
diff NEWS @ 2944:e9c24f32f175
[project @ 1997-05-08 02:42:22 by jwe]
author | jwe |
---|---|
date | Thu, 08 May 1997 02:42:41 +0000 |
parents | 2e1757f57ce6 |
children | da62d3b91fa3 |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -84,6 +84,25 @@ defines a function that returns the number of times that it has been called. + * Within user-defined functions, the new automatic variable `argn' + contains the names of the arguments that were passed to the + function. For example, + + function f (...) + for i = 1:nargin + stdout << "argn(" << i << ") = `" << deblank (argn(i,:)) \ + << "' and its value is " << va_arg () << "\n"; + endfor + endfunction + f (1+2, "foo", sin (pi/2)) + + prints + + argn(1) = `1 + 2' and its value is 3 + argn(2) = `"foo"' and its value is foo + argn(3) = `sin (pi)' and its value is 1 + + on the standard output stream. If nargin is zero, argn is not defined. * Functions like quad, fsolve, and lsode can take either a function name or a simple function body as a string. For example,