octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.1.39 : No more argn ?


From: John W. Eaton
Subject: Re: 2.1.39 : No more argn ?
Date: Mon, 4 Nov 2002 14:40:28 -0600

On  3-Nov-2002, Paul Kienzle <address@hidden> wrote:

| I can confirm that argn doesn't work for me in 2.1.38 or 2.1.36, but the code
| for processing it is still in ov-usr-fcn.cc.  The last working version is 
2.1.35.
| 
| octave:1> function f, nargin, end
| octave:2> f(1)
| nargin = 1
| octave:3> x=1;
| octave:4> f(x)
| nargin = 1
| octave:5> function f, argn, end
| octave:6> f(x)
| error: `argn' undefined near line 1 column 13
| error: called from `f'
| 
| Presumably removing the initializer for arg_nm in the tree_index_expression 
constructor
| is the source of the problem.  See the following diff:
|  
| 
http://www.octave.org/cgi-bin/cvsweb.cgi/octave/src/pt-idx.cc.diff?r1=1.11&r2=1.12&f=h

No, because arg_nm was still handled in the append() function (or at
least it is in the current sources).

I think the following patch should solve the problem.

Thanks,

jwe


2002-11-04  John W. Eaton  <address@hidden>

        * oct-obj.h (octave_value_list::operator =): Copy names too.
        (octave_value_list::octave_value_list (const octave_value_list&)):
        Likewise.


Index: oct-obj.h
===================================================================
RCS file: /usr/local/cvsroot/octave/src/oct-obj.h,v
retrieving revision 1.34
diff -u -r1.34 oct-obj.h
--- oct-obj.h   26 Sep 2002 22:10:08 -0000      1.34
+++ oct-obj.h   4 Nov 2002 20:38:51 -0000
@@ -95,7 +95,7 @@
     : data (1, octave_value (r)) { }
 
   octave_value_list (const octave_value_list& obj)
-    : data (obj.data) { }
+    : data (obj.data), names (obj.names) { }
 
   void *operator new (size_t size)
     { return allocator.alloc (size); }
@@ -106,7 +106,10 @@
   octave_value_list& operator = (const octave_value_list& obj)
     {
       if (this != &obj)
-       data = obj.data;
+       {
+         data = obj.data;
+         names = obj.names;
+       }
 
       return *this;
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]