From: Rick DeNatale Date: 2006-08-13T10:43:40+09:00 Subject: Re: PATCH to make internal Hash class retain order... On 8/12/06, Hal Fulton wrote: > Well, if it were another class, then you would lose the order > information before you ever got into that class, right? > > hash = {a=>1, b=>2, c=>3} > > ordered = OrderedHash.new(hash) # Oops -- too late The case of initializing with a hash is problematical, but OrderedHash[a, 1, b, 2, c, 3] could work if you want control the order on initialization. And OrderedHash.new(hash) or OrderedHash[hash] could be defined to set the order to hash.keys -- Rick DeNatale http://talklikeaduck.denhaven2.com/