Mercurial > octave-nkf
comparison src/ov-usr-fcn.cc @ 11558:1e4dfc7a9487
use .argn. to store argument names for inputname function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 17 Jan 2011 13:59:35 -0500 |
parents | e9d72a3caa46 |
children | 12df7854fa7c |
comparison
equal
deleted
inserted
replaced
11557:e9d72a3caa46 | 11558:1e4dfc7a9487 |
---|---|
542 (const string_vector& arg_names, int nargin, int nargout, | 542 (const string_vector& arg_names, int nargin, int nargout, |
543 const octave_value_list& va_args, const std::list<octave_lvalue> *lvalue_list) | 543 const octave_value_list& va_args, const std::list<octave_lvalue> *lvalue_list) |
544 { | 544 { |
545 if (! arg_names.empty ()) | 545 if (! arg_names.empty ()) |
546 { | 546 { |
547 // It is better to save this in the hidden variable .argn. and | |
548 // then use that in the inputname function instead of using argn, | |
549 // which might be redefined in a function. Keep the old argn name | |
550 // for backward compatibility of functions that use it directly. | |
551 | |
547 symbol_table::varref ("argn") = arg_names; | 552 symbol_table::varref ("argn") = arg_names; |
553 symbol_table::varref (".argn.") = Cell (arg_names); | |
554 | |
555 symbol_table::mark_hidden (".argn."); | |
548 | 556 |
549 symbol_table::mark_automatic ("argn"); | 557 symbol_table::mark_automatic ("argn"); |
558 symbol_table::mark_automatic (".argn."); | |
550 } | 559 } |
551 | 560 |
552 symbol_table::varref (".nargin.") = nargin; | 561 symbol_table::varref (".nargin.") = nargin; |
553 symbol_table::varref (".nargout.") = nargout; | 562 symbol_table::varref (".nargout.") = nargout; |
554 | 563 |