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

 
 

bug #30941: truncated subsrefs array in 3.3.52+

Submitted by:  Pascal Dupuis <cdemills>
Submitted on:  Wed 01 Sep 2010 01:27:39 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Wont FixAssigned to: Jaroslav Hajek <highegg>
Originator Name: Pascal DupuisOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>In charge of this item.
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>
Project Member

 

(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 highegg (Posted a comment)
  • -unavailable- added by cdemills (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
    Thu 02 Sep 2010 05:59:04 AM UTChigheggItem GroupSegfault, Bus Error, etc.=>Incorrect Result
      StatusNone=>Wont Fix
      Assigned toNone=>highegg
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1