Changes between Version 15 and Version 16 of ArrayTasklist

Show
Ignore:
Timestamp:
10/23/09 18:39:34 (12 years ago)
Author:
kurahaupo
Comment:

Arrays as mix-ins

Legend:

Unmodified
Added
Removed
Modified
  • ArrayTasklist

    v15 v16  
    4949 * Is there room to make new types of resizable array that target raw buffer use and ''don't'' allow push, pop, shift and unshift? 
    5050 
    51  * The current implementations of resizable array PMC's are derived from fixed-sized array PMC's. However the (current) use of the "size" field -- provided by the base PMC -- is arguably incorrect, in that it does not track the allocated size as it would for the fixed-sized version. Instead of changing the meaning of "size" in the base PMC, we should call it "allocated_size", and then in the derived PMC have "logical_size". This means that the memory-safety of the "allocated_size" bound is then implemented only once, within the base PMC. 
     51 * Is the inheritance from Fixed to Resizeable wrong? 
    5252 
    53  * A general-purpose resizable array would need these attrs: 
    54    * element_type (int8, int16, int32, int64, int128, float32, float64, float128, string, pmc) 
    55    * allocated_size 
    56    * initialized_size 
    57    * logical_size 
    58    * index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) 
     53 * What's the difference between "Array" and "ResizeablePMCArray"? 
    5954 
    6055 * My dictionaries can't agree whether the spelling is "resizable" or "resizeable"; if the latter, should we fix the spelling now, later, or never? 
     
    6459Arrays are overloaded to perform several roles: 
    6560 
     61 * Tuple (A composite value being a list of values, rather than a container) 
    6662 * Indexable ("Hashes with Integer Keys") 
    6763 * Stack (Push and Pop, or Shift and Unshift) 
     
    9187 * Deprecate and remove Array PMC type. 
    9288 
     89 * The current implementations of resizable array PMC's are derived from fixed-sized array PMC's. However the (current) use of the "size" field -- provided by the base PMC -- is arguably incorrect, in that it does not track the allocated size as it would for the fixed-sized version. Instead of changing the meaning of "size" in the base PMC, we should call it "allocated_size", and then in the derived PMC have "logical_size". This means that the memory-safety of the "allocated_size" bound is then implemented only once, within the base PMC. 
     90 
     91 * Refactor all the classes as mix-ins between two groups of classes: 
     92   # one group of classes that know the type of each element (int, num, str, pmc, any), and 
     93   # another group of classes that compute memory addresses for indexed elements, perform resizing (or not), and report number of elements. 
     94   (These latter would if necessary target the roles listed above, but a single compromise implementation would also work. -- kurahaupo) 
     95 
     96   A general-purpose resizable array would need these attrs: 
     97   * element_type (bit, int8, int16, int32, int64, int128, float32, float64, float128, string, pmc, any) 
     98   * allocated_size 
     99   * initialized_size 
     100   * logical_size 
     101   * index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) 
     102 
    93103= Related Tickets = 
    94104