From: Austin Ziegler Date: 2006-08-14T11:17:36+09:00 Subject: Re: hash.keys and hash.values On 8/13/06, Chad Perrin wrote: > On Mon, Aug 14, 2006 at 07:31:05AM +0900, Hal Fulton wrote: > > They'll certainly be the same order. It would be crazy otherwise. > Not necessarily. It could be that, when calling on them separately, > they are accessed in a different order -- and only when using one to > reference the other do their associations come to light. It's > conceivable where there might come a time when someone decides, for > implementation reasons, that this might be a better way to handle it. > It's still less surprising for them to be accessed in the same order, > though, so it's nice that it's implemented this way in absence of a > compelling reason to do otherwise. They would be the same order so long as no changes have been made to the internal hash table. ;) So, "yes unless you modify the hash or you're in threaded code which might modify the hash." -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca