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

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

[Octave-bug-tracker] [bug #55768] display of classdef object should not


From: Rik
Subject: [Octave-bug-tracker] [bug #55768] display of classdef object should not show private or protected properties
Date: Fri, 22 Feb 2019 18:34:18 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

URL:
  <https://savannah.gnu.org/bugs/?55768>

                 Summary: display of classdef object should not show private
or protected properties
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Fri 22 Feb 2019 03:34:16 PM PST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

When displaying a classdef object, all properties are printed including Hidden
and Protected properties.  This is not what Matlab does, nor is it what the
properties() function does which is also confusing.

Consider the following classdef file in testprop.m (also attached):


classdef testprop

        properties
                testprop = 0;
        end

        properties (Access = protected)
                protectedtestprop = 0;
        end

        properties (Hidden = true)
                hiddentestprop = 0;
        end

end


Code to reproduce.


octave:1> x = testprop
x =

testprop object with properties:

     hiddentestprop: [1x1 double]
  protectedtestprop: [1x1 double]
           testprop: [1x1 double]

octave:2> properties (x)
properties for class testprop:

  hiddentestprop
  testprop



The fact that the properties() function shows hidden properties was separately
reported at bug #55766.

In terms of architecture, the disp() function for class objects should
probably not implement it's own logic.  Instead it should probably call to the
underlying function that implements properties() so that it stays in sync with
fixes there and there is no code duplication.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 22 Feb 2019 03:34:16 PM PST  Name: testprop.m  Size: 177B   By: rik5

<http://savannah.gnu.org/bugs/download.php?file_id=46336>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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