Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Are ordered hashes useful?



On 8 February 2011 11:38, Stephen J. Turnbull <stephen@example.com> wrote:

> Josh Glover writes:
>
>  > Ruby has a hash that keeps the keys FIFO ordered, if that makes sense.
>  > The first key you put in is the first key that
>  > GoogleOnlyKnowsTheNameOfTheHashClass#keys will return.
>
> Do you know of any use cases for it?

I've never needed it myself, in any language I've used, but I suppose
it might be useful if you needed to guarantee the order of hash keys
across multiple runs of your program. The order is likely to be the
same anyway, but it seems wrong to rely on that.

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links