bugGNU Octave - Bugs: bug #30941, truncated subsrefs array in 3.3.52+

 
 

bug #30941: truncated subsrefs array in 3.3.52+

Submitter:  Pascal Dupuis <cdemills>
Submitted:  Wed 01 Sep 2010 01:27:39 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  highegg
Originator Name:  Pascal Dupuis Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Sep 2010 05:59:04 AM UTC, comment #1: 

This change is intentional. Matlab doesn't allow two consecutive () subscript, while Octave does allow them in expressions (not assignment). Hence, Matlab class code may not be prepared for such chains. That's why Octave splits the index chain at that point, to stay compatible yet still allow indexed expressions.

If you wish to rediscuss this change, please open a discussion at the maintainers' list.

In any case, if Y = X(1:3, 1)(:).cell is supposed to work differently than Z = X(1:3, 1); Y = Z(:).cell,
I strongly recommend you revise the design, because that's very confusing IMHO. If .cell just indicates the type of the desired result, why not make it
X.cell(1:3, 1)(:)?


Jaroslav Hajek <highegg>
Wed 01 Sep 2010 01:27:39 PM UTC, original submission:  

Hello,

the following code works as expected in 3.2.4, and fails in dev:
x=dataframe('octave_frame/data_test.csv');
x(1:3, 1)(:).cell

Under 3.2.4, subsref is called with a 3x1 S struct. Under 3.3.52+, subsref is called with a 1x1 S struct, and further dereferencing occurs in the context of the result of x(1:3, 1), of class 'char'.

Matlab documentation states that in the case of cascaded subsref, length(S) is the number of levels. Could you restore 3.2.4 behavior ?

Regards

Pascal

Pascal Dupuis <cdemills>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by highegg (Posted a comment)
  • -email is unavailable- added by cdemills (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-02 highegg Item GroupSegfault, Bus Error, etc. Incorrect Result
        StatusNone Wont Fix
        Assigned toNone highegg
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code