From: Chad Perrin Date: 2006-08-15T03:01:10+09:00 Subject: Re: hash.keys and hash.values On Tue, Aug 15, 2006 at 12:06:51AM +0900, Mage wrote: > Chad Perrin wrote: > > > >I suspect people don't even get as far as taking it for granted, since > >they probably tend to access one from the other in almost all cases. > > > On the second week of my Ruby "experience" I found myself writing a > method (for a very basic db layer) where hash.keys and hash.values could > come in play. > So I think it's a natural need. After a short Google session I found > others dealing with this, most of them assumed that they have same order. I stand corrected. > > Based on the answers of this thread I believe they are, however until it > becomes documented I will use hash.to_a.transpose in production environment. That's probably an excellent policy. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "It's just incredible that a trillion-synapse computer could actually spend Saturday afternoon watching a football game." - Marvin Minsky