OrderPreservingDictionary preserves the order in which elements were added to to it.
Metacello new
baseline: 'OrderPreservingDictionary';
repository: 'github://pharo-contributions/OrderPreservingDictionary/src';
load.
Basic Dictionary
(dict := Dictionary new)
at: #apple put: 20;
at: #orange put: 15.
dict keys. "#(#orange #apple)"
OrderPreservingDictionary
(dict := OrderPreservingDictionary new)
at: #apple put: 20;
at: #orange put: 15.
dict keys. "#(#apple #orange)"