bugGNU Octave - Bugs: bug #32772, subsref only expects one argument...

 
 

bug #32772: subsref only expects one argument out

Submitted by:  Vincent Rabaud <vrabaud>
Submitted on:  Sun 13 Mar 2011 11:22:44 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 27 Jan 2014 01:56:35 AM UTC, comment #2:

Oh, and looking at this one more time, I actually got this to work with the following change to @MyObject/subsref:

That seems like a usable workaround to me.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Jan 2014 01:49:39 AM UTC, comment #1:

I notice this bug hasn't received any attention or further comments. I also notice the page linked to on TMW website is no longer there. I think the preferred way to do what you are requesting in Matlab now is to define classes using the classdef syntax. Work is currently underway to support classdef classes in Octave. I suspect the syntax your example uses is deprecated in Matlab now since classdef supersedes and improves on it.

I'm going to close this as won't fix, since there is probably little interest in implementing a deprecated feature now that classdef will be supported soon. Feel free to reply to keep this bug open if I'm misunderstanding.

Mike Miller <mtmiller>
Project Administrator
Sun 13 Mar 2011 11:22:44 PM UTC, original submission:

When creating an object (cf tar file) in a @ folder, if subsref is overloaded, nargout is always 1 while it not necessarily is.

subsref is not only used to access data members but also to call member functions which can return more than one argument (as detailed on http://www.mathworks.com/help/techdoc/matlab_oop/brdqinq.html in the "Dot Notation vs. Function Notation" section).

The given tar file contains a bogus object that should not crash when called this way:
obj=MyObject;
[a,b]=obj.do_something(1);

Thank you, I love octave !

Regards,
Vincent

Vincent Rabaud <vrabaud>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #22919:  object.tar added by vrabaud (10KiB - application/x-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by vrabaud (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
    Mon 27 Jan 2014 01:49:39 AM UTCmtmillerStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Thu 10 Oct 2013 07:14:19 PM UTCrik5Item GroupSegfault, Bus Error, etc.=>Incorrect Result
    Sun 13 Mar 2011 11:22:44 PM UTCvrabaudAttached File-=>Added object.tar, #22919

    Back to the top


    Powered by Savane 3.1-cleanup1