rcl
rcl copied to clipboard
Don't alphabetize dict keys
I find it surprising that it alphabetizes keys in dicts rather than using the order I use internally. As an example from another oss project - Python has treated dicts as ordered for a while.
I agree, this is a behavior that I want to change in the future to preserve insertion order, and there are to dos for it in the code and in the documentation.
There are downsides to it too (it breaks the property that a == b ⇒ f(a) == f(b)), but right now now I’m leaning towards that preserving insertion order is a more useful property than this particular form of referential transparency.
The current behavior is an artifact of dicts being implemented with a BTreeMap.