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: Sat, 16 May 2015 19:02:22 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 Iceweasel/35.0.1

Update of bug #34967 (project octave):

                Priority:              5 - Normal => 3 - Low                
              Item Group:        Incorrect Result => Matlab Compatibility   
                  Status:               Need Info => Confirmed              
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #5:

I think we would want to aim for Matlab compatibility here, so I had someone
test for me.


>> s = struct('name', {});


This is a zero-length struct array with one field "name".

Non-existent fields always return an error, whether the size of the struct
array is zero or not, so for us this should look like:


>> size(s)
ans =
   0   0
>> s.foo
error: structure has no member 'foo'


Valid field names should return an empty cs-list when the struct array size is
zero, so using it alone fails with an error but concatenation in an array
should work.

    _______________________________________________________

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]