From: Martin DeMello Date: 2006-08-25T02:14:27+09:00 Subject: Re: Call for crystalization --was:A use case for an ordered hash On 8/24/06, ara.t.howard@noaa.gov wrote: > HistoryHash = Alib::OrderedHash > > hh = HistoryHash.new > hh[:one] = 1 > hh[:two] = 2 > hh[:one] = 3 > hh.each do |k, v| p k end > > harp:~ > ruby a.rb > :one > :two > > because it's based on __insertion__ order. if one wants a new insertion use: That depends on what you see yourself as inserting, though. If you take it as k=>v pairs, then you can see :one => 1 being replaced by :one => 3, which has then been inserted *after* :two => 2. martin