From bug-octave-request at bevo dot che dot wisc dot edu Fri Nov 6 13:31:48 1998 Subject: more 2.1.8 problems From: "John W. Eaton" To: Joao Cardoso Cc: bug-octave Date: Fri, 6 Nov 1998 13:31:19 -0600 (CST) On 6-Nov-1998, Joao Cardoso wrote: | This example from the ChangLog file does not work | | octave-2.1.8:1> 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)) | > stdout << "argn(" << i << ") = `" << deblank (argn(i,:)) \ | > << "' and its value is " << va_arg () << "\n"; | > endfor | > endfunction | octave-2.1.8:2> f (1+2, "foo", sin (pi/2)) | argn(1) = `error: `argn' undefined near line 3 column 57 | error: evaluating index expression near line 3, column 57 | error: evaluating argument list element number 1 | error: evaluating index expression near line 3, column 48 | error: evaluating binary operator `<<' near line 3, column 45 | error: evaluating binary operator `<<' near line 4, column 18 | error: evaluating binary operator `<<' near line 4, column 43 | error: evaluating binary operator `<<' near line 4, column 56 | error: evaluating for command near line 2, column 9 | error: called from `f' Please try the following patch. Thanks, jwe Fri Nov 6 12:14:29 1998 John W. Eaton * pt-idx.cc: Don't forget to define arg_nm. Move contstructor here. * pt-idx.h: From here. Index: pt-idx.h =================================================================== RCS file: /home/jwe/src/master/octave/src/pt-idx.h,v retrieving revision 1.4 diff -c -r1.4 pt-idx.h *** pt-idx.h 1997/06/01 19:29:22 1.4 --- pt-idx.h 1998/11/06 19:24:06 *************** *** 47,54 **** public: tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0, ! int l = -1, int c = -1) ! : tree_expression (l, c), expr (e), list (lst), arg_nm () { } ~tree_index_expression (void); --- 47,53 ---- public: tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0, ! int l = -1, int c = -1); ~tree_index_expression (void); Index: pt-idx.cc =================================================================== RCS file: /home/jwe/src/master/octave/src/pt-idx.cc,v retrieving revision 1.4 diff -c -r1.4 pt-idx.cc *** pt-idx.cc 1997/05/16 21:00:48 1.4 --- pt-idx.cc 1998/11/06 19:28:46 *************** *** 38,43 **** --- 38,49 ---- // Index expressions. + tree_index_expression::tree_index_expression (tree_expression *e = 0, + tree_argument_list *lst = 0, + int l = -1, int c = -1) + : tree_expression (l, c), expr (e), list (lst), + arg_nm (lst ? lst->get_arg_names () : string_vector ()) { } + tree_index_expression::~tree_index_expression (void) { delete expr;