#813: [RFC] Deprecate (parts) of OrderedHash.
--------------------+-------------------------------------------------------
Reporter: bacek | Owner:
Type: RFC | Status: new
Priority: normal | Milestone:
Component: core | Version: 1.3.0
Severity: medium | Keywords:
Lang: | Patch:
Platform: |
--------------------+-------------------------------------------------------
Hello.
Current implementation of OrderedHash is hack over Hash which has few
design flows:
1. It relies on particular Hash implementation.
2. It "leaks" Hash buckets during removal.
3. It breaks LSP for integer keys.
4. It implements methods such "push_pmc" which doesn't make sense for
Hash.
My proposal is:
1. Rename it to something like "Dictionary" or "LookupTable".
2. Change it to "has-a Hash" instead of "is-a Hash". Just to prevent
assumptions about contract.
3. Disallow removal of keys (because currently inside Parrot we never
remove keys from OrderedHash). It will simplify guts and allow to remove
hack with "bucket leak".
4. (Optional) Put big warning message "Internal use only, enter on your
own risk".
--
Bacek
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/813>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets