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

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

[Octave-bug-tracker] [bug #30087] isfield responds incorrectly to multip


From: Esben Skovenborg
Subject: [Octave-bug-tracker] [bug #30087] isfield responds incorrectly to multiple field-names
Date: Tue, 08 Jun 2010 22:02:55 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)

URL:
  <http://savannah.gnu.org/bugs/?30087>

                 Summary: isfield responds incorrectly to multiple
field-names
                 Project: GNU Octave
            Submitted by: esskov
            Submitted on: Tue 08 Jun 2010 10:02:54 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.3
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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