| 21 | | They were originally included as counterparts to the Fixed Arrays, but extended to support pop, push, shift, unshift and set-integer. However it seems that the lack of initialization is a misplaced optimization that is probably of no use to any HLL, forcing every HLL to override this behaviour. |
| | 31 | They were created as extensions of fixed-sized arrays, extended to support pop, push, shift, unshift and set-integer, but ''not'' extended to guarantee initialization. However it seems likely that the lack of initialization is a misplaced optimization that is probably of no use to any HLL, forcing every HLL to override this behaviour. Does anyone implementing a language say otherwise? |
| 27 | | * Is there room to make new types of Resizable Arrays that target raw buffer use and ''don't'' allow push, pop, shift and unshift? |
| | 37 | * Is there room to make new types of resizable array that target raw buffer use and ''don't'' allow push, pop, shift and unshift? |
| | 38 | |
| | 39 | * 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. |
| | 40 | |
| | 41 | * A general-purpose resizable array would need these attrs: |
| | 42 | * allocated_size |
| | 43 | * initialized_size |
| | 44 | * logical_size |
| | 45 | * index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) |
| | 46 | |
| | 47 | * My dictionaries can't agree whether the spelling is "resizable" or "resizeable"; if the latter, should we fix the spelling now, later, or never? |
| | 48 | |
| | 49 | == Role separation == |
| | 50 | |
| | 51 | Arrays are overloaded to perform several roles: |
| | 52 | |
| | 53 | * Indexable ("Hashes with Integer Keys") |
| | 54 | * Stack (Push and Pop, or Shift and Unshift) |
| | 55 | * Queue (Push and Shift, or Unshift and Pop) |
| | 56 | |
| | 57 | Should we have separate PMC's that optimize for each of these roles? |