octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #34967] Bad behavior of structures with an emp


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #34967] Bad behavior of structures with an empty cell
Date: Mon, 27 Jan 2014 02:27:10 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Update of bug #34967 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                  Status:                    None => Need Info              
                 Release:                   3.4.2 => dev                    

    _______________________________________________________

Follow-up Comment #4:

The following commands still produce odd results in the current development
version of Octave (4.1.0+):


octave:1> val = struct("name", {});
octave:2> val.foo
octave:3> val.bar
octave:4> [1, 2, val.name, 4, 5]
ans = [](0x0)


I'm assuming what we want is the same behavior as if val were a non-empty
struct array:


octave:1> val.name = {};
octave:2> val.foo
error: structure has no member 'foo'
octave:3> val.bar
error: structure has no member 'bar'
octave:4> [1, 2, val.name, 4, 5]
ans =
{
  [1,1] = 1
  [1,2] = 2
  [1,3] = 4
  [1,4] = 5
}


Or should array concatenation produce an error as in the assignment case, as
below?


octave:4> x = val.name
error: value on right hand side of assignment is undefined
octave:5> [1, 2, val.name, 4, 5]
error: value on right hand side of assignment is undefined


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34967>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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