octave-maintainers
[Top][All Lists]
Advanced

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

Re: error: some elements undefined in return list


From: John W. Eaton
Subject: Re: error: some elements undefined in return list
Date: Mon, 05 Nov 2007 18:39:00 -0500

On  6-Nov-2007, Kim Hansen wrote:

| On 11/5/07, John W. Eaton <address@hidden> wrote:
| >
| > Please try the following patch.  I don't think it breaks anything, but
| > it would help to have some other people do some testing.
| 
| I have tested the patch, all test passes, but I get errors with
| constructions like this:
| 
| octave:3> x=cell()
| x = {}(0x0)
| octave:4> x{1}.y=2
| error: invalid matrix index = 1
| error: evaluating assignment expression near line 4, column 7
| octave:4>

In the future, please reply on the list.

Does the following additional patch help?

jwe


Index: src/pt-idx.cc
===================================================================
RCS file: /cvs/octave/src/pt-idx.cc,v
retrieving revision 1.39
diff -u -u -r1.39 pt-idx.cc
--- src/pt-idx.cc       5 Nov 2007 21:51:25 -0000       1.39
+++ src/pt-idx.cc       5 Nov 2007 23:38:12 -0000
@@ -495,7 +495,8 @@
                          {
                            std::string ttype = type.substr (0, i);
 
-                           if (ttype[ttype.length()-1] == '(')
+                           char c = ttype[ttype.length()-1];
+                           if (c == '(' || c == '{')
                              {
                                octave_idx_type nel = 1;
 
@@ -545,7 +546,9 @@
                              {
                                std::string ttype = type.substr (0, i);
 
-                               if (ttype[ttype.length()-1] != '(')
+                               char c = ttype[ttype.length()-1];
+
+                               if (! (c == '(' || c == '{'))
                                  {
                                    octave_value_list tmp_list
                                      = first_retval_object.subsref (ttype, 
idx, 1);

reply via email to

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