[Top][All Lists]

[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


                 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



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

                testprop = 0;

        properties (Access = protected)
                protectedtestprop = 0;

        properties (Hidden = true)
                hiddentestprop = 0;


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:


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



Reply to this item at:


  Message sent via Savannah

reply via email to

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