Menu

#1354 Queue lists excess instance methods

5.0.0
closed
Erich
None
none
1
2023-01-01
2015-10-24
Erich
No

Queue lists instance methods like makeString, size, sort, sortWith, stableSort, stableSortWith, toString that it shouldn't really have.

rexx -e "say .Queue~methods(.nil)~allIndexes~sort~makeString(, ', ')~lower

allindexes, allitems, append, at, delete, empty, first, firstitem, hasindex, hasitem, index, init, insert, isempty, items, last, lastitem, makearray, makestring, next, peek, previous, pull, push, put, queue, remove, removeitem, section, size, sort, sortwith, stablesort, stablesortwith, supplier, tostring, [], []=

Discussion

  • LesK

    LesK - 2015-10-25

    All those that you mention are in the list produced by your code.
    Is there some Object concept I'm missing?

     
    • Erich

      Erich - 2015-10-25

      The Queue class doesn't have its own implementation of e. g. sort(), which
      is what .Queue~methods(.nil) reports.
      Queue still allows for sorting, because it inherits sort() from the
      OrderedCollection class.

      The bug reported is an assumed wrong behavior of methods() which should
      report less unique instance methods for Queue than it currently does.

       
      • Rick McGuire

        Rick McGuire - 2015-10-25

        No, these methods have been added to all of the ordered collections in 5.0.

         
        • Erich

          Erich - 2015-10-25

          methods(.nil) returns instance methods for the receiving class only, not
          for inherited methods. etc.

          OrderedCollection is fine, has sortWith() etc.

          OrderedCollection~methods(.nil)~allIndexes~sort~makeString(, ', ')~lower
          
          append, appendall, delete, difference, first, firstitem, insert,
          intersection, last, lastitem, next, previous, section, sort, sortwith,
          stablesort, stablesortwith, subset, union, xor
          

          List is fine, hasn't got sortWith() etc.

          "say .List~methods(.nil)~allIndexes~sort~makeString(, ', ')~lower
          allindexes, allitems, append, at, delete, empty, first, firstitem,
          hasindex, hasitem, index, init, insert, isempty, items, last, lastitem,
          makearray, next, previous, put, remove, removeitem, section, supplier, [],
          []=
          

          Queue is wrong, has sortWith()etc.

          .Queue~methods(.nil)~allIndexes~sort~makeString(, ', ')~lower
          allindexes, allitems, append, at, delete, empty, first, firstitem,
          hasindex, has
          item, index, init, insert, isempty, items, last, lastitem, makearray,
          makestring
          , next, peek, previous, pull, push, put, queue, remove, removeitem,
          section, siz
          e, sort, sortwith, stablesort, stablesortwith, supplier, tostring, [], []=
          
           
  • Erich

    Erich - 2017-03-11
    • assigned_to: Erich
    • Pending work items: none --> code
     
  • Erich

    Erich - 2017-03-11
    • status: open --> pending
    • Pending work items: code --> none
     
  • Erich

    Erich - 2017-03-11

    removed methods makeString, sort, sortwith, stablesort, stablesortwith, tostring
    documented method size() as a synonym for items()

    Committed code fix with revision [r11214].
    Documented method size() with revision [r11215].

     

    Related

    Commit: [r11214]
    Commit: [r11215]

  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel