Hey! where's #count?

Be careful with that assumption. I believe that as a hash expands it
occasionally needs to re-hash it's keys, and that would alter the order.
I don't know that Ruby's hash works that way, but most of the ones I've
encountered do.

See [ruby-talk:44548] and [ruby-talk:12151], there is

  "(if you don't modify the hash)"

Guy Decoux

I use it in this case

what case? i’d like to see an example. i worry about depending on that.
what if something changes in Ruby 1.7+ and the orders start coming out
different?

~transami

···

On Mon, 2002-07-15 at 03:12, ts wrote:

how do you utilize that order?

I use it in this case

Well, try #each, #keys and #values and you’ll see that the objects are
given in the same order : this is (for me) important

Guy Decoux


~transami

(") dobee dobee do…
\v/
^ ^

Be careful with that assumption. I believe that as a hash
expands it
occasionally needs to re-hash it’s keys, and that would alter
the order.
I don’t know that Ruby’s hash works that way, but most of the
ones I’ve
encountered do.

See [ruby-talk:44548] and [ruby-talk:12151], there is

“(if you don’t modify the hash)”

It’s probably a semantic argument at this point and what is working
for you seems to work for you, but I’d would NOT call a data
structure which maintains an order with no relationship to the order
that the items were inserted, and can (and will!) change its order
whenever its contents are changed “ordered”.

But again, that’s me.

···

=====

Use your computer to help find a cure for cancer: http://members.ud.com/projects/cancer/

Yahoo IM: michael_s_campbell


Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes

what case? i'd like to see an example. i worry about depending on that.

[ruby-talk:12123]

what if something changes in Ruby 1.7+ and the orders start coming out
different?

[ruby-talk:12151]

Guy Decoux