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

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

[Octave-bug-tracker] [bug #53614] classdef properties() function not imp


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #53614] classdef properties() function not implemented
Date: Wed, 13 Feb 2019 03:36:57 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36

Follow-up Comment #2, bug #53614 (project octave):

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

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?53614>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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