Daniel Stutzbach wrote:
On Sat, May 9, 2009 at 5:17 AM, spir
I feel the same. Unorder (like in dict or set) is not a feature, I guess. Set is useful for it ensures uniqueness of items, not because of unorder. A kind of "unique-item" sequence would do as well. Unorder is rather a consequence of hash implementation for performance, but I cannot find any use case where it would be a useful feature. Examples welcome.
Unorder is an absence of a feature, so it will never be "useful". However, unorder frees up the implementation to be more efficient since there is less information to keep track of.
Also, insertion order isn't always the desired order. For example, maintaining a sorted list of unique items is often handy. In other cases, a different ordering may be useful.
There's also the question of whether the order is significant. Does a == b if a and b contain exactly the same items, but in a different order? If they are lists, then yes; if they are multisets, then no.