On 8/22/06, Robert Dober <robert.dober / gmail.com> wrote:
>
> First there would be the SortedHash and all you sayed was true about it
> (save that iteration would be slower, which seems wrong to me).
> And then there might be the OrderedHash, which is a Hash without any
> overhead, just offering different access methods,
> which would implement order this might be a bad idea, as the access sorting
> can so easily be done ourselfs.

The thing is, there's no way to preserve insertion order in a hash
without using some extra storage, and taking a bit of extra time on
insertion and deletion. Lookup and iteration would not have their
speed affected, but insertion and deletion definitely would because
you'd have to make sure the insertion order was preserved too.

martin