------art_48439_3129131.1156187852417
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 8/21/06, Hal Fulton <hal9000 / hypermetrics.com> wrote:
>
> Robert Dober wrote:
> > On 8/15/06, Hal Fulton <hal9000 / hypermetrics.com> wrote:
> >>
> >> OHash lookup should be as fast as Hash lookup.
> >>
> >> Insertion would be slightly slower,
> >
> > Not necessarily
> > that was why I suggested an
> > OrderedHash (where insertion would not be slower )
> > and a
> > SortedHash (where indeed insertion would be slower)
> >
> > and iteration (and to_a) would
> >
> >> be slowed down more.
>
> I meant an ordered hash would be slowed down simply
> because you are storing an extra piece of information.


I know but I would not be storing that extra piece of information in one of
the variants of the two new Hashes I was dreaming of.

I think I know where there might be a different conception and you are
probably rightnot to worry about the OrderedHash.

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.
I wanted to talk about the concept anyway as it might be interesting to
folks thinking about their own implementations.

Cheers
Robert

Hal
>
>


-- 
Deux choses sont infinies : l'univers et la bóŐise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.

- Albert Einstein

------art_48439_3129131.1156187852417--