bugGNU Octave - Bugs: bug #30087, isfield responds incorrectly to...

 
 

bug #30087: isfield responds incorrectly to multiple field-names

Submitted by:  Esben Skovenborg <esskov>
Submitted on:  Tue 08 Jun 2010 10:02:54 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: David Grundberg <grundberg>
Originator Name: Open/Closed: Closed
Release: 3.3.51Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 09 Jun 2010 01:23:25 PM UTC, comment #1:

Pushed changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/e0ba186b242b

Thanks for reporting.

David Grundberg <grundberg>In charge of this item.
Tue 08 Jun 2010 10:02:54 PM UTC, original submission:

Years ago Matlab extended the isfield function to accept a cell array as the second argument. The return value would then be a logical array with values corresponding to whether each field existed in the struct.

s = struct('a',1, 'b',2);
isfield(s,{'a','c'})

Expected result: [true false]
Octave 3.2.3 result: [false]

This extended syntax for isfield is very convenient, and is used in some Matlab scripts which would otherwise run nicely in Octave.

I've set the Item Group to Incorrect Result (rather than Feature Request) because Octave fails to warn the user that it does not (yet) support this syntax, but instead returns what Matlab users would consider an incorrect result.

Esben Skovenborg <esskov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by grundberg (Updated the item)
  • -unavailable- added by esskov (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Jun 2010 01:23:25 PM UTCgrundbergStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release3.2.3=>3.3.51
    Wed 09 Jun 2010 12:16:01 PM UTCgrundbergAssigned toNone=>grundberg

    Back to the top


    Powered by Savane 3.1-cleanup1