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

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

[Octave-bug-tracker] [bug #55766] properties function should not return


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55766] properties function should not return Hidden properties
Date: Fri, 14 Jun 2019 14:07:32 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Update of bug #55766 (project octave):

                  Status:                    None => In Progress            

    _______________________________________________________

Follow-up Comment #2:

I used gdb to step through the compute_attribute_value function and
"tw.evaluate (expr)" does evaluate the expression to be a octave_value object
that is logical true.  So I think that part is working properly so your change
there is not needed.  It's your change to
cdef_class::cdef_class_rep::find_properties that has the effect of omitting
the hidden property.  But I'm not sure that's the right place for this change.
 Should that function return all public properties, even if they are hidden? 
Also, you added the check inside the block where the property is not found
directly, so we are then looking for inherited properties.  That doesn't seem
quite right to me.  So I made the following change instead:

http://hg.savannah.gnu.org/hgweb/octave/rev/b15b71bcd679

Given the modified test case


classdef testprop

  properties
    testprop = 0;
  end

  properties (Access = public)
    publictestprop = 0;
  end

  properties (Access = protected)
    protectedtestprop = 0;
  end

  properties (Hidden)
    hiddentestprop = 0;
  end

  properties (Hidden = true)
    anotherhiddentestprop = 0;
  end

  properties (Hidden = false)
    notahiddentestprop = 0;
  end

end


I now see


octave:1> x = testprop;
octave:2> properties (x)
properties for class testprop:

  notahiddentestprop
  publictestprop
  testprop


so I believe that fixes the problem reported here.

However, I also see


octave:3> x
x =

  testprop object with properties:

      anotherhiddentestprop: [1x1 double]
             hiddentestprop: [1x1 double]
         notahiddentestprop: [1x1 double]
          protectedtestprop: [1x1 double]
             publictestprop: [1x1 double]
                   testprop: [1x1 double]



If the hidden and protected properties are also supposed to be hidden from
this display, then I think that is a separate but similar change.  What does
Matlab do for this new test case?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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