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

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

[Octave-bug-tracker] [bug #55961] properties function does not preserve


From: ImadES
Subject: [Octave-bug-tracker] [bug #55961] properties function does not preserve order
Date: Mon, 10 Jun 2019 08:38:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

Follow-up Comment #3, bug #55961 (project octave):

I have just attached a patch in file 'suggested_fix_for_bug_55961_1.patch'.

Octave (built from the most recent sources) now returns:


octave:2> properties (prop_tester_1)
properties for class prop_tester_1:

  ff_from_1
  dd_from_1
  a_from_1
  ee_from_1
  b_from_1
  c_from_1
  cc_from_1
  bb_from_1

octave:3> properties (prop_tester_2)
properties for class prop_tester_2:

  f_from_2
  d_from_2
  e_from_2
  ff_from_1
  dd_from_1
  a_from_1
  ee_from_1
  b_from_1
  c_from_1
  cc_from_1
  bb_from_1

octave:4> properties (prop_tester_3)
properties for class prop_tester_3:

  ccc_from_3
  bbb_from_3
  aaa_from_3
  eee_from_3
  f_from_2
  d_from_2
  e_from_2
  ff_from_1
  dd_from_1
  a_from_1
  ee_from_1
  b_from_1
  c_from_1
  cc_from_1
  bb_from_1


Just a not about 'duplicates': Matlab will not allow a classdef class to
'overload' a property already found in an ancestor. Any attempt to do such a
thing triggers an error message along the lines of:


Error using prop_tester_3
Cannot define property 'e_from_2' in class 'prop_tester_3' because the
property has already been defined in the superclass
'prop_tester_2'.


However, Octave allows this, and the existing code was careful not to return
the same property twice. I preserved this behaviour  in the sense that there
are no duplicates in the returned property list, and a property is returned
when it is first encountered while exploring the ancestor list (from the
considered child to the most remote ancestor).

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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