#187 Please allow argument on Collection classes 'NEW'

Rejected
closed
nobody
Classes (154)
5
2012-08-14
2007-06-09
No
0 up votes | 0 down votes | 0%
2 comments

Working with the new features of the collection classes and experimenting with putAll and a supplier the utility of creating different collection class renderings can be enhanced, if the 'NEW' method of the collection classes accepted an optional argument, either a collection or a supplier (and in the case of ordered or set collections any object that possesses a MAKEARRAY method).

The generic INIT-code for the collection classes could look like:

------------ cut here ------------
::METHOD INIT
use strict arg initialItems=.nil

 if arg(1, "E") then
 do
    if self~isA(.OrderedCollection) then
       self~appendAll(initialItems)  
    else
       self~putAll(initialItems)       
 end

------------ cut here ------------

This would ease coding for the purpose of rendering a collection or supplier to a specific collection at creation time. E.g.

m=.array~methods / get a supplier /
r=.relation~new(m) / create a relation, add the supplier index/item pairs to it /

Alternatively (already possible) one could code the same as:

m=.array~methods / get a supplier /
r=.relation~new / create a relation /
r~putAll(m) / add the supplier index/item pairs to it /

Discussion

  • Rick McGuire
    Rick McGuire
    2007-06-12

    Logged In: YES
    user_id=1125291
    Originator: NO

    This is not a good idea, as it will make it difficult and awkward to extend the new method to add additional options to the collections in the future. For example, adding initial capacity and expansion strategy options to table, et al would be a good future enhancement. This feature overlaps with function already available to the particular collections, so it doesn't really add any capability while at the same time creates additional complications for the future.

     
  • Rick McGuire
    Rick McGuire
    2007-06-12

    Logged In: YES
    user_id=1125291
    Originator: NO

    Notice: This RFE is slated to be rejected.

    Reason: See the RFE item in the SourceForge Tracker system for the rejection reason.

    To appeal this rejection please contact the Appeals Committee via Mr. Chip Davis

    oorexx-rfe-appeals@oorexx.org

    All further correspondence on this RFE should be directed to the Appeals Committee and MUST include this RFE number.

    The decision of the Appeals Committee is final.

     
  • Rick McGuire
    Rick McGuire
    2007-07-16

    Logged In: YES
    user_id=1125291
    Originator: NO

    This RFE has now passed the 30-day mark since rejection without appeal. This RFE is now closed.

     


Anonymous


Cancel   Add attachments