bugGNU Octave - Bugs: bug #53614, classdef properties() function not...

 
 

bug #53614: classdef properties() function not implemented

Submitter:  Rik <rik5>
Submitted:  Wed 11 Apr 2018 06:31:48 PM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 02 Mar 2019 09:50:15 PM UTC, comment #4: 

The properties function works.  If preserving order is important (rather than just being Matlab compatible) then a new bug should be filed.  There are already other bug reports now against the properties() function on Savannah.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 13 Feb 2019 11:26:19 AM UTC, comment #3: 

If preserving the order is important, we can do that.

John W. Eaton <jwe>
Group administrator
Wed 13 Feb 2019 08:36:57 AM UTC, comment #2: 

jwe, thanks for your implementation.  One (important?) difference to Matlab I noticed is that the order of the properties is preserved.  When changing the order, the order changes the output of properties, too.  On the other hand, I do not find a hint in the ML documentation that supports the requirement for the properties to be ordered.

For our example "test/classdef/foo_value_class.m" we have the properties


properties
  rate;
  term;
  principle;
end


Octave 6.0.0 seems to have sorted those properties:


>> obj = foo_value_class ();
>> properties (obj)
properties for class foo_value_class:

  principle
  rate
  term


while Matlab R2018b says:


>> obj = foo_value_class ();
>> properties (obj)

Properties for class foo_value_class:

    rate
    term
    principle


The root of this trouble must be the design decision to store properties inside a map, which is sorted by keys by default.

https://hg.savannah.gnu.org/hgweb/octave/file/84355b7b9521/libinterp/octave-value/ov-classdef.h#l500

Kai Torben Ohlhus <siko1056>
Group Member
Tue 12 Feb 2019 09:29:16 PM UTC, comment #1: 
John W. Eaton <jwe>
Group administrator
Wed 11 Apr 2018 06:31:48 PM UTC, original submission:  

For classdef objects, the properties keyword has been implemented which is used when defining objects.  However, the function properties() which would list the properties that have been defined does not exist.

Rik <rik5>
Group administrator

 

(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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by rik5 (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-02 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-02-12 jwe StatusConfirmed Ready For Test
    2019-01-12 jwe Severity3 - Normal 1 - Wish
        Item GroupMatlab Compatibility Feature Request
    2019-01-12 jwe Priority5 - Normal 3 - Low
    2018-07-18 siko1056 Dependencies- bugs #54294 is dependent

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code