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

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

[Octave-bug-tracker] [bug #62802] "methods classdef" shows some methods


From: Colin Macdonald
Subject: [Octave-bug-tracker] [bug #62802] "methods classdef" shows some methods twice
Date: Sun, 31 Jul 2022 16:41:10 -0400 (EDT)

Follow-up Comment #6, bug #62802 (project octave):

I don't know anything about this code, but maybe that wallpapers over
something else?  I guess the question is whether the code should be:

if ~is_classdef:  # (pseudocode)
    // The following will also find methods for legacy @CLASS objects.
   load_path& lp = interp.get_load_path ();

   sv.append (lp.methods (class_name));


Personally, I'd be fine with adding a comment:

   // The following will also find methods for legacy @CLASS objects.
+  // this may count methods twice for classdef classes, Bug #62802
   load_path& lp = interp.get_load_path ();

   sv.append (lp.methods (class_name));
+  sv.sort(true);

   return ovl (Cell (sv));
 }


IMHO, returning sorted methods sounds good for deterministic testing and
pleasant user experience.  I doubt there are classes where the performance hit
of sorting would be significant.

I'm happy to test a patch!


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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